mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Parser: Add radio parser. See #1502
This commit is contained in:
parent
99bfd81f63
commit
4ea1bb2858
@ -1,4 +1,4 @@
|
||||
/*! Parser: input & select - updated 5/16/2017 (v2.28.10) *//*
|
||||
/*! Parser: input & select - updated 2018-01-30 (v2.29.5) *//*
|
||||
* for jQuery 1.7+ & tablesorter 2.7.11+
|
||||
* Demo: http://mottie.github.com/tablesorter/docs/example-widget-grouping.html
|
||||
*/
|
||||
@ -66,6 +66,19 @@
|
||||
type : 'text'
|
||||
});
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: 'radio',
|
||||
is: function() {
|
||||
return false;
|
||||
},
|
||||
format: function(txt, table, cell) {
|
||||
var $input = $(cell).find('input:checked');
|
||||
return $input.length ? $input.val() : txt;
|
||||
},
|
||||
parsed: true,
|
||||
type: 'text'
|
||||
});
|
||||
|
||||
// Custom parser which returns the currently selected options
|
||||
// updated dynamically using the 'change' function below
|
||||
$.tablesorter.addParser({
|
||||
|
Loading…
Reference in New Issue
Block a user