tablesorter

How can I make table being capable of sorting with Twitter Bootstrap?

瘦欲@ 提交于 2020-01-03 07:30:08
问题 I want to know how can I make my table being capable of sorting with Twitter Bootstrap? What are the things to be considered? 回答1: There is a library that provides the capability of sorting with bootstrap tables. Here's a quick demonstration of how to use it. HTML: <table class="table table-bordered table-striped sortable"> <thead> <tr> <th data-defaultsign="month" data-sortcolumn="1" data-sortkey="1-1"> Date </th> </tr> </thead> <tbody> <tr> <td data-dateformat="D-M-YYYY">16.4.2004</td> </tr

jQuery tablesorter plugin does not work after AJAX call

☆樱花仙子☆ 提交于 2020-01-02 08:24:24
问题 I have used jQuery table sorter plugin in my code. It works fine as long as I don't make an ajax request to load the table data dynamically. I am using combo boxes to filter the contents of the table by ajax. I read few posts which says using $("table").trigger("update"); can solve my problem. I tried it with my code but the problem is still there. Is there any other way to solve this problem? Please help me figure out a solution. I am really stuck bad. Any help would be appreciated. Below is

JQuery TableSorter Comma-Digit Parser not working

*爱你&永不变心* 提交于 2020-01-01 19:07:10
问题 Here's my problem, I am currently using the JQuery Table Sorter and I found a Comma-Digit parser on the web. The problem I am having is it doesn't seem to be working. So here is what the column is sorted as: 4,666 141,666 293 341,666 346 461,676 This should be sorted as 293 346 4,666 141,666 341,666 461,676 The parser I am using is this: $( function() { $.tablesorter.addParser({ id: "fancyNumber", is: function(s) { return /^[0-9]?[0-9,\.]*$/.test(s); }, format: function(s) { return $

JQuery TableSorter Comma-Digit Parser not working

孤人 提交于 2020-01-01 19:06:05
问题 Here's my problem, I am currently using the JQuery Table Sorter and I found a Comma-Digit parser on the web. The problem I am having is it doesn't seem to be working. So here is what the column is sorted as: 4,666 141,666 293 341,666 346 461,676 This should be sorted as 293 346 4,666 141,666 341,666 461,676 The parser I am using is this: $( function() { $.tablesorter.addParser({ id: "fancyNumber", is: function(s) { return /^[0-9]?[0-9,\.]*$/.test(s); }, format: function(s) { return $

jquery tablesorter sort date dd mmm yyyy

旧城冷巷雨未停 提交于 2019-12-31 05:42:08
问题 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

jQuery: tablesorter plugin, disabling sorting on some columns

蹲街弑〆低调 提交于 2019-12-31 03:50:09
问题 I'm trying to disable sorting of one column in my 3 col table. Following the docs I came up with this: $('table.sortable').tablesorter( {sortList: [[0,0], [0,0], [0,0]], textExtraction: myTextExtraction}, {headers: {0:{sorter:true}, 1:{sorter:true}, 2:{sorter:false}}} ); Official docs here 回答1: I think your code is almost correct. Your textExtraction option needs to be in its own {}, and you don't need to specify the default header options. Try this: $('table.sortable').tablesorter( {

Tablesorter zebra doesnt stripe till sort

▼魔方 西西 提交于 2019-12-30 18:48:08
问题 I have my tables and they are great I can sort them and it works wonderfully except that they don't do the zebra striping until I sort them for the first time. My understanding was that they will be striped as soon as table sorter is initialized, is this not the case? This is tablesorter v 2.10 (the latest) from here: http://mottie.github.io/tablesorter/docs/index.html 回答1: Your problem is most probably related to the fact that the table is not visible ( display: none ) when you initialize

Can I change the <td> background if a field result is great or equal to another field?

柔情痞子 提交于 2019-12-30 11:01:13
问题 I am displaying mySQL in an html table. I would like to change the TD background color of $qty to red IF $qty >= $max or $qty =< $min . Is there a simple a way to do this with jQuery or PHP? I simplified my table and PHP for my example: <table id="tablesorter-demo"> <tr><td>'.$min.'</td><td>'.$max.'</td><td>'.$qty.'</td></tr> </table> 回答1: var min = $('table tr td:eq(0)').text(); var max = $('table tr td:eq(1)').text(); var qty = $('table tr td:eq(2)').text(); if (qty >= max || qty <= min ) {

TableSorter : how to export results to csv?

人盡茶涼 提交于 2019-12-30 07:09:10
问题 TableSorter is a great jquery script to sort html tables with many options. But I don't know how to add a simple 'export to csv' button (or link) to get a file containing the records of my table (with no special formatting). I know the Output Plugin but it seems far too complex to me. Thanks by advance for your help ! Ted 回答1: It's actually not complicated, it only looks intimidating because of all the options. The output widget can output csv, tsv, any other separated (space, semi-colon, etc

How do I sort a column that contains two divs with jQuery Tablesorter?

走远了吗. 提交于 2019-12-30 05:15:08
问题 I'm using jQuery Tablesorter to sort a table. One of my columns looks like this: <td> <div> <span class="green">Yes</span> <a href="##">(unverify)</a> </div> <div class="hidden"> <span class="red">No<>/a> <a href="##">(verify)</a> </div> </td> In other words, there's two divs, one to show Yes in green with a link, and the other to show No in red with a link. One of the divs is always hidden, and the two are toggled whenever the user clicks on the link. jQuery Tablesorter cannot sort on this