jeudi 9 mai 2019

uncheck multiple checkboxes in different tabs on same time using data tables

I have two tabs in my page and both are using server side data table to append tables in which first column is multiple select checkboxes. On all select checkboxes, you can delete data and it gets transferred from 1st tab to second tab, then when we select select all checkbox options in 2nd tab checkboxes of first tab also get selected. So how to stop checkboxes boxes in both the tabs on the same time. Checkboxes are created by the data table column render.

datatable column rendering-

'columnDefs': [{ 'targets': 0, 'checkboxes': { 'selectRow': true,
},

On click event for delete button to move data from one tab to another tab-

$(document).on('change','.dt-checkboxes,.dt-checkboxes-select-all',function()

{

   if($(".dt-checkboxes").is(":checked")){
    $(".delete_all").removeAttr('hidden');
    $(".Revoke_all").removeAttr('hidden');

    }
    else
    {
     $(".delete_all").attr("hidden",true);
     $(".Revoke_all").attr("hidden",true);

     }

});




Aucun commentaire:

Enregistrer un commentaire