Capturing event after sorting by date using jquery

I have a problem with datable (http://www.datatables.net), jQuery and Firefox.

I have jQuery datatable ( id="equipmentList") using the button above:

<html:button styleId="deleteButton" property="delete" value="<%= buttonDelete %>" disabled="disabled" />

When I sort the column into datatable, I want to disable the button (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 sorting ends, because after that my button is jQuery on; or something different. so I'm looking for a capture event at the end of the sort order to disable my button

Any ideas?

Thank you very much in advance

PS: sorry for bad english

+5
source share
1 answer

, , 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%" }
        ]
    });

:

http://datatables.net/usage/callbacks

+7

All Articles