tablesorter

Remove jQuery tablesorter from table

若如初见. 提交于 2019-11-28 01:50:43
I am using the jQuery tablesorter (http://tablesorter.com). After being applied to a table by $('#myTable').tablesorter() , how can I remove it again from the table? There isn't a built-in function to do this, but you could remove the class names and event bindings to stop its functioning... try something like this: $('table') .unbind('appendCache applyWidgetId applyWidgets sorton update updateCell') .removeClass('tablesorter') .find('thead th') .unbind('click mousedown') .removeClass('header headerSortDown headerSortUp'); The above won't work if you have the pager plugin running. Volker

Jquery Tablesorter - sort by column having <input> elements

房东的猫 提交于 2019-11-27 23:57:25
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). I'm using JQuery's Tablesorter to sort my tables. And I'd like to be able to sort by the column

Why are some JavaScript developers using setTimeout for one millisecond? [duplicate]

霸气de小男生 提交于 2019-11-27 22:18:10
This question already has an answer here: Why is setTimeout(fn, 0) sometimes useful? 17 answers I have problem when using jQuery plugin tablesorter and I can't call trigger twice. For example this won't work: this._$table.trigger('update'); this._$table.trigger('sorton', [[[1,1]]]); But this works: this._$table.trigger('update'); setTimeout($.proxy(function() { this._$table.trigger('sorton', [[[1,1]]]); }, this), 1); And then I see that problem was in trigger 'update', it call method with body: function () { var me = this; setTimeout(function () { // rebuild parsers. me.config.parsers =

How to sort one column via several ways in a header?

倾然丶 夕夏残阳落幕 提交于 2019-11-27 15:52:35
I have the tablesorter from motti and I can't find out a simple way to sort a certain column in more than one way from 2 different hot areas in the same header. (One way via "gamename" and another via "percentage".) My code already sorts on Game on the gamename, but it does do the same when clicking on percentage (so the latter not by percentage, but by name). What's the least-code way to do this? (Preferably with existing tablesorter options.) Table header column: <th>Game <span class="percSort">%</span></th> Body column: <th class="gamename"> <div style="width:66%;background-color: hsla(84

How to disable sorting on column in jQuery.tablesorter?

南楼画角 提交于 2019-11-27 14:38:30
问题 I try to find a way how to disable sorting on column. I use jQuery plugin tablesorter. And by default if you click on header cell it sort column data, but what I need to do if I don't need to use sorting on one or two column in four columns table. Thanks in advance. 回答1: You must pass the appropriate parameters at initialization, for example: { ... headers: { 0: { sorter: false} } } For more information, check the manual at: http://tablesorter.com/docs/ 回答2: Also you can use html data

jquery tablesorter index column insert

烂漫一生 提交于 2019-11-27 09:51:08
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/javascript"> </script> <script src="/media/js/jquery.tablesorter.pager.js" type="text/javascript"></script>

“e.handler.apply” is not a function in jquery table sorter

自作多情 提交于 2019-11-27 07:52:44
问题 In one of my application I am using JQUERY tablesorter.But while sorting with any of the cloumns I am getting below error. Any idea why this is happening. Error : "e.handler.apply" is not function in Jquery.js My code to use table sorter is as below. $(".tablesorter") .tablesorter( { headers: { 0: { sorter: false}}, widgets: ['zebra'], fixedHeight: false }) .tablesorterPager({ container: $(".pager") }); $("#sortHeader").click( $(".tablesorter") .bind("sortStart",function(e, table) { $('

Updating jQuery Tablesorter plugin after removing a row from DOM

余生长醉 提交于 2019-11-27 04:30:58
I have some code at the moment that hides a row that is deleted and then removes it using the .remove() function. However I'm having difficulty is making it remain "deleted" as every time I refresh the table sorted pager plugin or the filter plugin addon I'm using.. the deleted rows re-appear as they are of course cached. Current code just simple with widget update at the moment $('.deleteMAP').live("click", function(){ $(this).closest('tr').css('fast', function() { $(this).remove(); $(".tablesorter").trigger("update"); $(".tablesorter").trigger("applyWidgets"); }); }) Is there anyway to

Using jQuery tableSorter on dynamically modified table

萝らか妹 提交于 2019-11-27 02:11:26
问题 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? 回答1: I believe you can trigger an update using something like: $(table).trigger("update") 回答2: Seems you are

Getting jQuery tablesorter to work with hidden/grouped table rows

。_饼干妹妹 提交于 2019-11-27 01:55:55
问题 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