tablesorter

How to create a specific sorting function in jQuery Tablesorter?

孤街浪徒 提交于 2019-12-19 04:03:38
问题 I am using this great version of jQuery Tablesorter: http://mottie.github.com/tablesorter/docs/index.html Everything is working well but now I have this problem: in my table, I have one column which contains positions of basketball players. Therefore I want that column to be sorted logically like this: PG-SG-SF-PF-C. I tried to create this custom sorting function - look at my script, column 2: $(document).ready(function() { $(".stats").tablesorter({ sortInitialOrder: 'desc', sortRestart: true

jquery tablesorter CSS arrow icons

倾然丶 夕夏残阳落幕 提交于 2019-12-19 03:59:22
问题 This is really more of a CSS question than a jQuery question. I'm using the tablesorter jQuery plugin to sort tables dynamically. Here's what it looks like currently: Here's the CSS code that I'm using: th.sortable{ font-weight: bold; cursor:pointer; background-repeat: no-repeat; background-position: center right; } th.headerSortUp { background-image: url("arrow-up.gif"); } th.headerSortDown { background-image: url("arrow-down.gif") } The problem that I have with the current implementation is

Sort only one column with jquery and tablesorter

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-19 03:16:33
问题 At the moment im using jquery tablesorter and tablesorter filter. My problem is that i want that my filter would filter only one column. Now its filtering all columns. You can see my site here: http://tinyurl.com/3j38vye Now its filtering all colums and i'd like to filter only "Lainasumma" column. Could you also say why its not sorting amounts properly? 回答1: Did you look at the documentation? Here is an example of how you would disable some columns that use tablesorter. You can pass a headers

jQuery tablesorter is not sorting number correctly

冷暖自知 提交于 2019-12-18 12:53:00
问题 I've been trying for days now to get jQuery tablesorter correctly sort numbers in my table column. I am using the current latest versions of both scripts. The table is rendered fine, but sorting the numbers is not working correctly. When I sort a number column it gives me the following results: 8 7 4 32 31 3 etc.. where you would expect: 32 31 8 etc... I read some comments on adding extra javascript code but I can't find any good javascript examples. The jQuery I'm using now is as follows: $

Using jQuery tablesorter to sort mm/yy dates

跟風遠走 提交于 2019-12-18 06:12:40
问题 I am using the jquery tablesorter plugin to sort a table. On of my the columns in my table shows the date in mm/yy format. <tr> <td class="col-name">...</td> ... <td rel="2000" class="col-dob">10/00</td> ... </tr> <tr> <td class="col-name">...</td> ... <td rel="1986" class="col-dob">11/86</td> ... </tr> Note: Each cell has a unique class Date is displayed in the mm/yy format Cell with date receives the year as well My jQuery code is as below: // add parser through the tablesorter addParser

Jquery Tablesorter - sort by column having <input> elements

a 夏天 提交于 2019-12-17 16:35:56
问题 I have a table like this: | Update | Name | Code | modification date | | | name1 | code1 | 2009-12-09 | | | name2 | otehercode | 2007-09-30 | Where the Update column contains checkboxes <input type='checkbox' /> . The checkbox initial state is determined before rendering the table, but after the rows are fetched from database (it's based on set of conditions, on the server-side). The checkbox can be checked by default, unchecked by default or disabled ( disabled='disabled' as input attribute)

jquery tablesorter index column insert

寵の児 提交于 2019-12-17 10:05:00
问题 I have a PHP generated table from a postgres query. How can I insert an index column with numbered rows at the beginning of the table using tablesorter plugin? The sorting works. Thank you. klejgkekrj qwef <html> <head> <link href="/media/css/blue/style.css" rel="stylesheet"> <script src="/media/js/jquery.js" type="text/javascript"></script> <script src="/media/js/jquery.tablesorter.js" type="text/javascript"></script> <script src="/media/js/jquery.tablesorter.widgets.js" type="text

Tablesorter combining sortList with disabled columns

邮差的信 提交于 2019-12-14 03:10:42
问题 I feel sure this is a simple answer but as a rookie I'm failing to see it. I just want a table to have column 0 and 2 disabled from the sort, then the default sort to be column 1. Two separate commands, but while they work individually they seem to clash together. I can have my columns 0 and 2 disabled and the table works perfectly. Or I can have my initial sort set to column 2 and the table works perfectly. But when put together my remaining sortable columns will only allow one click, they

Problem with tablesorter & Jquery sorting prices with Euro sign

天大地大妈咪最大 提交于 2019-12-14 02:17:45
问题 My question concerns the Jquery plugin Tablesorter : I've a problem with the sorting of a columns with prices, formatted like that : 135.35 €, 149.99 €, 1500 €, etc The sorting works well with the numbers only, but when i add the Euro symbol , the sorting is not working anyore. I have this ASC order for the third columns (see code below) : 1) 1435 € 2) 190 € 3) 834 € As you can see there's something wrong. Can someone please tell me what should i do here? Thank you very much, Francois The JS

Creating HTML table from JSON with JQuery, trying to sort with Tablesorter plugin, but not working

99封情书 提交于 2019-12-13 20:05:20
问题 I'm having some trouble getting tablesorter to work with an HTML table that's being created with JQuery from JSON data. I get the table created, and the column headers highlight when I click them but it doesn't sort the data. The JQuery that creates the table is this: function buildHtmlTable() { var columns = addAllColumnHeaders(myList); for (var i = 0 ; i < myList.length ; i++) { var row$ = $('<tr/>'); for (var colIndex = 0 ; colIndex < columns.length ; colIndex++) { var cellValue = myList[i