So far it's been working very nicely but there were a couple of issues. The FixedColumns plugin wasn't setting the column width correctly for an empty table. That was fixed by setting the "iLeftWidth" property. I also needed to set it so that the first column could not sortable on. I found that the simplest way to do that was to use the "aoColumnDefs" property.
Here is my initialization script:
$(document).ready( function () {
var oTable = $('#tableID').dataTable( {
"aaSorting": [ [1, "asc"] ],
"sScrollY": "600px",
"sScrollX": "100%",
"bScrollCollapse": true,
"bStateSave": true,
"bPaginate": false,
//make first column not sortable
"aoColumnDefs": [{"bSortable": false, "aTargets": [0]}]
});
new FixedColumns( oTable, {
"iLeftWidth": "100"
});
});
So far I'm very impressed by what this jQuery plug-in can do. I have noticed that the page load times have increase. Waiting to see if this will be an issue for the end users.
No comments:
Post a Comment
Thank you for commenting!