tablesorter

jQuery tablesorter - Not sorting column with formatted currency value

风流意气都作罢 提交于 2019-11-30 04:42:42
jQuery 1.7.1 & tablesorter plugin - I have a currency column with thousand separators and values like $52.00 $26.70 $100.00 $50.00 $1,002.00 $1,102.00. When I try to sort getting sorted in the following way, $1,002.00 $1,102.00 $26.70 $50.00 $52.00 $100.00 Need values like, $26.70 $50.00 $52.00 $100.00 $1,002.00 $1,102.00 Tried many solutions mentioned here, but no success. Tablesorter allows you to define " custom parsers " for things like this. // add parser through the tablesorter addParser method $.tablesorter.addParser({ // set a unique id id: 'thousands', is: function(s) { // return

tablesorter with two header rows

旧巷老猫 提交于 2019-11-30 03:05:38
问题 I am using the tablesorter jquery plugin and my table has two rows in the header. Is there any way to enable sorting on my table? it should be able to be sortable by the second header row the first header row is just there to group related data by a date. If this is not possible using this plugin maybe someone has a suggestion for a workaround? Here is an example of my table markup <table> <thead> <tr> <th colspan="3">January</th> <th colspan="3">February</th> <th colspan="3">March</th> </tr>

Exclude a column from being sorted using jQuery tablesorter

£可爱£侵袭症+ 提交于 2019-11-30 01:57:51
I am looking for a way to exclude a single column from being sorted using jQuery's tablesorter plugin. Specifically, I have a fairly large table and would like to keep a "row number" column fixed so that it is easy to see what position in the table a particular row is, after sorting. For example: # name ----------- 1 papaya 2 apple 3 strawberry 4 banana When sorted on the name column, should result in: # name ----------- 1 apple 2 banana 3 papaya 4 strawberry Thanks. Brian Fisher Here is a widget you can use that will accomplish what you are looking for: $(function() { // add new widget called

How to work with Jquery Table Sorter with knockout

被刻印的时光 ゝ 提交于 2019-11-29 19:27:15
问题 I have a table on which i need to apply sorting. I'm using knockout and jquery.tablesorter.js. I have tried custom binding also but is not helping. Without knockout my code works fine. Below is my table. <table class="tbl" id="dash" data-bind="sortTable: true"> <thead> <tr class="tag close"> <th>Type</th> <th>Title</th> </tr> </thead> <tbody class="scrollContent" data-bind="foreach: Course"> <tr> <td><i class="icon"></i></td> <td><a href="#" id="qtipselector_01" data-bind="text: Title"></a><

Is there a way in tablesorter to filter to select only rows where the field is empty?

萝らか妹 提交于 2019-11-29 16:18:53
When I use '|Empty' in filter_functions no filtering is applied. I'd like to be able filter so that rows where the field is empty are shown. I just updated the tablesorter fork repository, so with v2.21.5+, you can now add a filter_function to target empty cells, and use the filter_selectSource to populate the select with custom and/or all column cell text as options ( demo ): $(function(){ $('table').tablesorter({ theme: 'blue', widgets: ['zebra', 'filter'], widgetOptions: { filter_functions: { 0: { '{empty}' : function (e, n, f, i, $r, c) { return $.trim(e) === ''; } } }, filter_selectSource

how to get current sort order from tablesorter plugin?

本秂侑毒 提交于 2019-11-29 06:30:41
I'm just starting to use Christian Bach's excellent TableSorter plugin, and I need to get a column's current sort direction. I have several columns: ID Name Category ID and Name are set to non-sortable using headers: { 0: {sorter: false}, 1: {sorter: false} } I'm adding a click handler on Name so that it fires the sort event on the Category column. Using the example " Sort table using a link outside the table ", I'm able to get the Name header to fire the Category sort -- but it's hard-coded to sort in one direction. How can I get it to look at the current direction the Category column is

jQuery tablesorter - Not sorting column with formatted currency value

99封情书 提交于 2019-11-29 02:03:31
问题 jQuery 1.7.1 & tablesorter plugin - I have a currency column with thousand separators and values like $52.00 $26.70 $100.00 $50.00 $1,002.00 $1,102.00. When I try to sort getting sorted in the following way, $1,002.00 $1,102.00 $26.70 $50.00 $52.00 $100.00 Need values like, $26.70 $50.00 $52.00 $100.00 $1,002.00 $1,102.00 Tried many solutions mentioned here, but no success. 回答1: Tablesorter allows you to define "custom parsers" for things like this. // add parser through the tablesorter

Is there a way in tablesorter to filter to select only rows where the field is empty?

旧巷老猫 提交于 2019-11-28 09:23:10
问题 When I use '|Empty' in filter_functions no filtering is applied. I'd like to be able filter so that rows where the field is empty are shown. 回答1: I just updated the tablesorter fork repository, so with v2.21.5+, you can now add a filter_function to target empty cells, and use the filter_selectSource to populate the select with custom and/or all column cell text as options (demo): $(function(){ $('table').tablesorter({ theme: 'blue', widgets: ['zebra', 'filter'], widgetOptions: { filter

Using jQuery tableSorter on dynamically modified table

与世无争的帅哥 提交于 2019-11-28 08:14:29
I am using the jQuery tableSorter plugin on a page. Unfortunatley, the table that is being sorted is dynamically modified, and when I sort after adding an element, the element disappears, restoring the table to the state that it was in when the tableSorter was created. Is there any way that i can force tableSorter to rescan the page so that these new elements are sorted properly? I believe you can trigger an update using something like: $(table).trigger("update") Seems you are correct. $(table).trigger("update"); $(table).trigger("appendCache"); does the trick. As a note, the tablesorter API

Getting jQuery tablesorter to work with hidden/grouped table rows

左心房为你撑大大i 提交于 2019-11-28 07:40:25
I have the classical table with expandable and collapsible records that if expanded show several subrecords (as new records in the same parent table, not some child div/child table). I am also using tablesorter and absolutely love it. The problem is that tablesorter isn't keeping expanded child records next to the parent records. It sorts them as if they were top level. So each time the table gets sorted by a column the child rows end up all over the place and not where I want them. Does anyone know of a good extension to tablesorter or specific configuration that enables tablesorter to keep