I've an issue with a datable (http://www.datatables.net), jQuery and Firefox.
I've a jQuery datatable (id="equipmentList"
) with a button above:
<html:button styleId="deleteButton" property="delete" value="<%= buttonDelete %>" disabled="disabled" />
When i'm sorting a column on the datatable, i want to disable a button (the button deleteButton
), so I wrote this code :
$('#equipmentList th').click( function() {
hideButtonEditAndDelete();
});
function hideButtonEditAndDelete() {
$("#modifyButton").attr("disabled", "disabled");
$( "#deleteButton" ).attr("disabled", "disabled");
//fix for firefox
if($.browser.mozilla){
$("#modifyButton").addClass('ui-state-disabled');
$("#deleteButton").addClass('ui-state-disabled');
}}
Everything goes well until the sort is ending because, after, my button is enabled by jQuery; or something else. so I'm looking for capture event at the end of sorting order to disable my button
There is a callback that is made every time that the table is redrawn and can be accessed on the fnDrawCallback:
$('#someTable').dataTable({
"fnInitComplete": function() {
// after table is intialised do something here
},
"fnDrawCallback": function() {
// after table is redrawndo something here
console.log("redrawn");
},
"bDestroy": true,
"bAutoWidth": false,
"bPaginate": false,
"sScrollY": "242px",
"bLengthChange": false,
"bInfo": false,
"bFilter": false,
"aaSorting": [[2, 'asc']],
"aoColumns": [
{ "sSortDataType": "dom-checkbox", "sWidth": "3%" },
{ "bSortable": true, "sWidth": "8%" },
{ "bSortable": true, "sWidth": "10%" },
{ "bSortable": true, "sWidth": "15%" },
{ "bSortable": true, "sWidth": "8%" },
{ "bSortable": true, "sWidth": "9%" },
{ "bSortable": true, "sWidth": "6%" },
{ "bSortable": false, "sWidth": "2%" },
{ "bSortable": false, "sWidth": "7%" },
{ "bSortable": false, "sWidth": "13%" },
{ "bSortable": false, "sWidth": "2%" },
{ "bSortable": false, "sWidth": "7%" },
{ "bSortable": false, "sWidth": "10%" }
]
});
More info on callbacks here:
http://datatables.net/usage/callbacks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With