Set Options Programmatically (after table initialization)
Set Options Programmatically (after table initialization)
I have been looking for an example of a way to set one of the datatable options after initialization. More specifically, in this case, I want to set column types (i.e. 'aoColumnDefs') just above or below the HTML table definition. Can anyone show me how to do this?
Even better would be a way to specify column type in an HTML attribute in the header. Is there currently a way to do that?
Even better would be a way to specify column type in an HTML attribute in the header. Is there currently a way to do that?
This discussion has been closed.
Replies
[code]
"aoColumnDefs": [
{
"sType": "whatever",
"aTargets": [ "myClass" ]
},
{
"sType": "whatever2",
"aTargets": [ "mySecondClass" ]
}
]
[/code]
Then just put 'myClass' on the TH elements you want to use sType of 'whatever'.
Allan
This is definitely a very jQuery way of doing things, and I could certainly use it. Is there a way to match on anything other than css class (i.e. like with any of the other jQuery selectors?).
Allan