mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-10-08 13:44:18 +00:00
checkbox parser now toggles "checked-#" row class name
This commit is contained in:
parent
5f366762f7
commit
a33fc74f57
@ -33,11 +33,15 @@
|
||||
is: function(){
|
||||
return false;
|
||||
},
|
||||
format: function(s, table, cell) {
|
||||
// using plain language here because this is what is shown in the group headers
|
||||
// change it as desired
|
||||
var $c = $(cell).find('input');
|
||||
return $c.length ? $c.is(':checked') ? 'checked' : 'unchecked' : s;
|
||||
format: function(s, table, cell, cellIndex) {
|
||||
var $c = $(cell).find('input'),
|
||||
isChecked = $c[0].checked;
|
||||
// adding class to row, indicating that a checkbox is checked; includes
|
||||
// a column index in case more than one checkbox happens to be in a row
|
||||
$c.closest('tr').toggleClass('checked-' + cellIndex, isChecked);
|
||||
// returning plain language here because this is what is shown in the
|
||||
// group headers - change it as desired
|
||||
return $c.length ? isChecked ? 'checked' : 'unchecked' : s;
|
||||
},
|
||||
type: "text"
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user