mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Parser: add select text parser. See #684
This commit is contained in:
parent
ad7468d5b0
commit
e84f2992d4
@ -64,6 +64,20 @@
|
||||
type: "text"
|
||||
});
|
||||
|
||||
// Select parser to get the selected text
|
||||
$.tablesorter.addParser({
|
||||
id: "select-text",
|
||||
is: function(){
|
||||
return false;
|
||||
},
|
||||
format: function(s, table, cell) {
|
||||
var $s = $(cell).find('select');
|
||||
return $s.length ? $s.find('option:selected').text() || '' : s;
|
||||
},
|
||||
parsed : true, // filter widget flag
|
||||
type: "text"
|
||||
});
|
||||
|
||||
// update select and all input types in the tablesorter cache when the change event fires.
|
||||
// This method only works with jQuery 1.7+
|
||||
// you can change it to use delegate (v1.4.3+) or live (v1.3+) as desired
|
||||
|
Loading…
Reference in New Issue
Block a user