Parser: Add radio parser. See #1502

This commit is contained in:
Rob Garrison 2018-01-30 12:58:24 -06:00
parent 99bfd81f63
commit 4ea1bb2858

View File

@ -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({