dimanche 28 juin 2015

Tablesorter checkbox not working

I am having trouble getting Tablesorter check box funtion. I would like to add a check box in thead with a purpose of giving user an option of check all or not.

Here is my jscript code:

<script type="text/javascript"> $(document).ready(function(){ $("#tabs").tabs({ create: function (event, ui) { var $t = ui.panel.find('table'); if ($t.length) { $t.tablesorter(tablesorterOptions2); } }, activate: function (event, ui) { var $t = ui.newPanel.find('table'); if ($t.length) { if ($t[0].config) { $t.trigger('applyWidgets'); } else { $("#table4").tablesorter(tablesorterOptions2); } } } });

var tablesorterOptions2 ={ theme: 'blue', widthFixed: true, widgets: ["zebra", "resizable" ,"columns" ,"stickyHeaders", "filter" , "editable"], headers: {0: { sorter: "checkbox" }}}; };

This is how my table starts out:

<table id='table4' class="tablesorter" width="100%"> <thead> <tr> <th><input type="checkbox"/></th>

data in the table disappears unless I sort and filter it couple of ways.

Thanks!




Aucun commentaire:

Enregistrer un commentaire