1.10 and a few questions...
1.10 and a few questions...
Trying to convert some current 1.9.4 code over to 1.10.
[code]
/* Default class modification */
$.extend( $.fn.dataTableExt.oStdClasses, {
"sWrapper": "dataTables_wrapper form-inline",
"sFilterInput": "form-control input-medium",
"sLengthSelect": "form-control input-small"
});
[/code]
For the above I found that classes are being applied correctly except sFilterInput... nothing is applied for it. Why I do not know? For the time being I am manually adding the class by [code]jQuery('#sample_1_wrapper .dataTables_filter input').addClass("form-control input-medium");[/code]
Second thing I've run into so far is disabling sorting for a particular column. In my case the first column in the table is a unique id that I am turning into a checkbox to allow users to check/uncheck rows. Previously I was able to use bSortable : false, but it appears I can no longer do that.
[code]
"columnDefs": [
{
"targets": [ 0 ],
"searchable": false,
"render": function ( data, type, row ) {
return '';
}
}
]
[/code]
How can I turn off sorting for this targeted column?
[code]
/* Default class modification */
$.extend( $.fn.dataTableExt.oStdClasses, {
"sWrapper": "dataTables_wrapper form-inline",
"sFilterInput": "form-control input-medium",
"sLengthSelect": "form-control input-small"
});
[/code]
For the above I found that classes are being applied correctly except sFilterInput... nothing is applied for it. Why I do not know? For the time being I am manually adding the class by [code]jQuery('#sample_1_wrapper .dataTables_filter input').addClass("form-control input-medium");[/code]
Second thing I've run into so far is disabling sorting for a particular column. In my case the first column in the table is a unique id that I am turning into a checkbox to allow users to check/uncheck rows. Previously I was able to use bSortable : false, but it appears I can no longer do that.
[code]
"columnDefs": [
{
"targets": [ 0 ],
"searchable": false,
"render": function ( data, type, row ) {
return '';
}
}
]
[/code]
How can I turn off sorting for this targeted column?
This discussion has been closed.
Replies
sFilterInput is new in 1.10 and is applied here: https://github.com/DataTables/DataTablesSrc/blob/master/js/core/core.filter.js#L18 . As I say, I'd need a test case to know why it isn't working.
2. bSortable or `sortable` will still work, but remember that the default aaSorting is `[[0, 'asc']]` and that will be applied to the table. If you don't want that, apply a different default.
Allan
[code]
"aaSorting": [],
"columnDefs": [
{
"targets": [ 0 ],
"searchable": false,
"sortable": false,
"render": function ( data, type, row ) {
return '';
}
}
],
[/code]
Allan
A, still happy to proofread/copyedit prior to pub.
KJM
Allan
KJM [/quote]
I'd be happy to help as well, if you like.