Adding custom attributes to Datatable
Adding custom attributes to Datatable
karthi_b
Posts: 3Questions: 0Answers: 0
I would like to customize Datatable to include my own attributes which I want to initialize while the datatable is created.
For example,
[code]
var oTable = jQuery('#example').dataTable({
'iDisplayLength' : 20,
'aoColumnDefs' : [
{'sType': 'custom-date','aTargets': [1]},
{'bSortable': false,'aTargets': [5]}
],
'retainFirst': true //custom attribute
});
[/code]
I would like to add a custom attribute 'retainFirst' to datatable which I want to initialize as either true/false. How can i do this?
For example,
[code]
var oTable = jQuery('#example').dataTable({
'iDisplayLength' : 20,
'aoColumnDefs' : [
{'sType': 'custom-date','aTargets': [1]},
{'bSortable': false,'aTargets': [5]}
],
'retainFirst': true //custom attribute
});
[/code]
I would like to add a custom attribute 'retainFirst' to datatable which I want to initialize as either true/false. How can i do this?
This discussion has been closed.
Replies
Allan
Quick question on this:
I have 5 columns in my table as shown in my headers
Trade IdDescriptionContributionTermDate
and I'm trying to understand how to implement that oTable code above.
Using this template, how to I specify the column names as well as some custom attributes I need:
var oTable = $('#pftable').dataTable({
'sScrollY': "500px",
'aoColumnDefs': [
]
});