tablesorter

Plugin not loading

穿精又带淫゛_ 提交于 2019-12-02 13:30:15
问题 This is driving me nuts. I checked and rewrote the code many times and it still doesn't work. Here it is: http://codepen.io/cwf/pen/zGBmgm Although tablesorter.js is loaded, $.tablesorter is undefined . I read all the questions here and can't find the problem, let alone the solution... Must be a little detail but I exhausted all options. Can anybody please have a quick look? Thanks! 回答1: jQuery was being loaded twice in that codepen... (updated demo) In the <head> jquery v2.1.4 is being

jquery tablesorter sort date dd mmm yyyy

喜欢而已 提交于 2019-12-02 12:03:14
I am pretty new to tablesorter but I have a table with several columns, and the 3rd column is dates, coming back from the DB in the form of dd mmm yyyy, hh:mm:ss (am/pm) For example 29 Jul 2013, 1:12:23 PM 2 Aug 2013, 3:59:59 PM 17 Jul 2013, 09:30:00 AM then I sort my table $(document).ready(function() { $("#myTable").tablesorter({sortInitialOrder: "desc"}); } ); but it comes out in "alphabetical order", meaning 29 before 2 before 17, not taking into account the date aspects. It looks like there is a dateFormat option I can pass in but I can't get it to work. I know Java has special keys with

jquery tablesorter : determining sort order for column

淺唱寂寞╮ 提交于 2019-12-02 11:21:13
问题 Is it possible for http://tablesorter.com to sort on different values depending on whether the sort is ascending or descending ? I see how to return sort values for a cell based on arbitrary data with a parser (i.e.: http://code-cocktail.in/hidden-value-sorting-in-jquery-tablesorter-plugin/ ) , so returning different values in different situations seems simple enough. The bit I'm banging my head on is that I cannot seem to determine the sort order when parsing. It looks like I can re-parse

Help to color-alternate rows in sortable table

ⅰ亾dé卋堺 提交于 2019-12-02 10:07:53
I'm using jQuery tablesorter plugin. I'm relatively new to jQuery and need help from jQuery ninjas. My table has color-alternative rows. I used CSS nth-child() to alternate the rows. table.tablesorter tbody tr:nth-child(odd) td { background-color:#FBFBFB; } It works fine in Chrome and Firefox but IE doesn't like it. IE doesn't support nth-child. I tried to control color-alternating with JavaScript when page loads. $(document).ready(function() { $('#packageTbl').tablesorter(); $('table.tablesorter tbody tr:nth-child(odd) td').css('background-color', '#FBFBFB'); $('table.tablesorter tbody tr:nth

Sorting Image and hyperlink columns in a table using JQuery Sorter plugin

ぃ、小莉子 提交于 2019-12-02 08:47:39
问题 I have a table with 3 columns, first column contains service name which is a hyperlink, second column contains a status icon, and the last column again an image for log file which is again a hyperlink.. I want to sort by first column which is a hyperlink, so the sorting should be done on the text of the hyperlink and also on second column which is an status icon based on the status weightage given below: <table border="0" cellspacing="0" cellpadding="3" class="services" width=100%> <thead>

Table sorter filter for each column

大憨熊 提交于 2019-12-02 08:24:33
Can you please help me to have table sorter with ajax for individual column. is there anything inbuilt method to call ajax call for filter column? My source code is below theme: 'blue', widthFixed: true, widgets: [ 'stickyHeaders', 'columnSelector','filter'], textExtraction: function(node, table, cellIndex){ return $(node).text().replace(/\s'/g,''); }, headers: {0: { filter: false},6: { filter: false},7: { filter: false},8: { filter: false}}, widgetOptions : { // Use the $.tablesorter.storage utility to save the most recent filters filter_saveFilters : false, // jQuery selector string of an

Sorting time hh:mm:ss with tablesorter plugin

▼魔方 西西 提交于 2019-12-02 07:32:24
问题 I'm using the tablesorter plugin and I have a column to sort in the format hh:mm:ss. sorter: 'time' does not work. Is there a way to sort this column? Thanks I have tried it like this but it does not sort the colum ts.addParser({ id: "customDate", is: function(s) { return false; }, format: function(s) { s = s.replace(/:/g," "); s = s.split(" "); return $.tablesorter.formatFloat(new Date(s[0], s[1]-1, s[2]).getTime()+parseInt(s[3])); }, type: "numeric" }); 回答1: There is already a built-in time

Sorting time hh:mm:ss with tablesorter plugin

百般思念 提交于 2019-12-02 05:38:39
I'm using the tablesorter plugin and I have a column to sort in the format hh:mm:ss. sorter: 'time' does not work. Is there a way to sort this column? Thanks I have tried it like this but it does not sort the colum ts.addParser({ id: "customDate", is: function(s) { return false; }, format: function(s) { s = s.replace(/:/g," "); s = s.split(" "); return $.tablesorter.formatFloat(new Date(s[0], s[1]-1, s[2]).getTime()+parseInt(s[3])); }, type: "numeric" }); There is already a built-in time parser for tablesorter, but it looks for an "AM" or "PM". But it looks like you need to sort using timer

sort table by price column

拟墨画扇 提交于 2019-12-02 04:17:56
It's the billing list: Service Price --------------- S1 13 CHF S2 Free S3 Free S4 40 CHF I want to sort it by price using jQuery or pure JavaScript. (not server-side) I tried jQuery Tablesorter , but it failed. Because some prices aren't number. ( Free ) What can I do? Can Tablesorter support it? Or I should use other plugins... You can write your own parser. See the documentation at: http://tablesorter.com/docs/example-parsers.html Working example: $.tablesorter.addParser({ id: 'price', is: function(s) { return false; }, format: function(s) { return s.replace(/Free/,0).replace(/ CHF/,""); },

Plugin not loading

ε祈祈猫儿з 提交于 2019-12-02 04:07:39
This is driving me nuts. I checked and rewrote the code many times and it still doesn't work. Here it is: http://codepen.io/cwf/pen/zGBmgm Although tablesorter.js is loaded, $.tablesorter is undefined . I read all the questions here and can't find the problem, let alone the solution... Must be a little detail but I exhausted all options. Can anybody please have a quick look? Thanks! jQuery was being loaded twice in that codepen... ( updated demo ) In the <head> jquery v2.1.4 is being loaded, and at the bottom of the document, next to where Bootstrap scripts are loaded, jQuery v1.11.2 is loaded