JQuery :: Disable Sorting On Specific Rows Using Tablesorter?
Apr 19, 2011
I have been using tablesorter2.0 plugin to sort the table. My requirement is such that I don't want few rows to be sorted. Like i can add a class like <tr class="nosort"> for rows to whom sorting should not be applied. And rest all rows should be sorted. Can't find a way to do this.
I have a table in which the first column is the row number (always from 1 at the top to 100 at the bottom) so no matter how the other columns are sorted that first column should be the 'rank' for that particular sort. Is it possible to do this with tablesorter? Could I change the values in the first column after tablesorter did it's work? I see how to disable sorting on the first column but that is not what I want.
How can I use textExtraction to sort based on whatever number is in that first LI element? I have tried various things, but just can't seem to get it. //Various forms of the below... trying to find the right path to the element. textExtractionCustom: { 0: function(o) { return $('li','ul.serversgs',o).html(); } } textExtraction: { 0: function(o) { return $('li','ul.serversgs',o).html(); } }
// This from within my own function called by whatever column I'm sorting by (0 above). return node.childNodes[0 ].childNodes[0 ].innerHTML; Am I wrong and I cannot do this, even though the sample above is directly from the Tablesorter site as an example of bypassing HTML markup inside the TDs?
I'm using tablesorter in my app and it's working great except.. the ip address sorting seems to be slightly broken. It will sort on the first two groups fine, on the third group it tries to sort once and gets it wrong and on the last group it won't sort at all.bob
After a bit of debugging the issue is that an ip address is being detected as a digit, i.e 192.168.1.100 is detected as the number 192.168 and hence only sorting on the first two groups. I fixed this by moving the digit to the end of the parsers. This is not a proper fix but works for me. Secondly the parser needs to be changed as follows. Without the debug line obviously. It was limiting each group to 2 characters and only sorting the first two groups.
I've been working on getting a table with a super header and sub headers to only sort by the sub headers. The example at [URL] shows this is possible but everytime I try to run the code the items in the top row are used to sort columns starting with 0. I've tried two different versions of jquery and re-downloaded Tablesorter twice now. It seems as if this should be easy and I'm just missing some amazingly simple thing.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/ TR/html4/strict.dtd"> <html> <head>
I have a div container that is used to specify where the table I retrieve via ajax is placed $("#div_reveal").html(AjaxResponse). I have tried to add an onSuccess function to update the table function (){ $("table").trigger("update"); } but the table does not sort. When I copy the output table directly into the page (static) it sorts. Therefore, I am assuming that the new table is not being added to the Dom and and is not being "recognized" by tablesorter. Does anyone know of a solution to retrieve and display a full html table via ajax and get tablesorter to sort it.
I'm using Tablesorter since few months and it was working very well.I did a small change yesterday in my php code: numbers over 1000 are nowformatted like this: 1 000, 1 000 000 instead of 1000 or 1000000.Since I did this change Tablesorter seems to have problems sorting this kindof formatted numbers with spaces. It just doesn't sort the way it should
With a tablesorter config that looks something like this: $("#table").tablesorter({ cssHeader: "sortAble", cssAsc: "sortAsc", cssDesc: "sortDesc", headers: {3: {sorter: 'time'}}, sortList: sortOrder, widgets: ['zebra'], widgetZebra: { css: ['','alt'] }, debug: true });
The alternating row style is not applied to the odd/even rows on the initial display of the table. If a user clicks any of the headers to change the sort-by column, or to change the sort-order, then the striping is applied. I'm using jQuery 1.3.2 and tablesorter 2.0.3. Searching the list for "tablesorter zebra", I found mention of needing to patch tablesorter 2.0.3 for 1.3.2 [URL] - does this still apply?
How can I use jquery to cycle through all the table rows I have in a table, and hide the rows that contain a specific HTML value that I pass to jquery?For instance, I have a table full of students, and courses each student is taking. If I want to hide all the rows where the course is Chemistry (regardless of student), how would I do that?I already have captured the HTML value, what I mainly need help with is how to tell jquery to hide ALL of the rows with that HTML value, rather than just the row I click on.
in a table I want to have a specific click event (calling a function) for the first cell of each row and another function call e.g. for the third table cell.I assigned different class names to these cells and used this script:$("#tab_kat tr").find(".firstCell").bind("click", function() { ... });And the same for ".thirdCell".But is this possible without assigning class names to reduce the size of the code?Something like that:$("#tab_kat tr td.cells[1]").bind("click", function() { ... });
I'm trying to disable and reenable certain items in a .net 2.0 radiobuttonlist using jquery.I have 3 tabs which control which radiobuttons are enabled or disabled.when tab 1 is clicked I disable radiobutton 2 like:
$("#ctl00_cphMain_cblStatus_2").attr("disabled", false); when I want to re-enable radiobutton 2 neither of these 2 methods seem to be working: $("#ctl00_cphMain_cblStatus_2").attr("disabled", false);
I have a field that use the 'remote' option to call a server sidescript to check the field value.If the field value is wrong, after each new key pressed, the remoteserver side is called.This could be very ennoying and increase the load on our server.There is a way to disable the "onkeyup" event only for a specificfield ?I have tried :
Is there away to alternate DIV rows in a specific section. When I try to alternate the DIVs it alternates everything that is a DIV on the page. I want to just alternate a DIV table.
I have an image map with various areas on it. A user can click on the various areas and something happens. That said, I sometimes need to disable the ability to click on some areas. For instance areas whose id attribute contains 0 0. I have the code to split the id and grab whether the values are 0 or 1 and the alert pops up when one has 0 0 in the id but it's still clickable. I thought .unbind would do the trick, but it isn't. The alert is simply for testing.
$('area').each(function(){ // Use the each() method to gain access to each elements id var idToDisable = $(this).attr("id");//get id of area var splitID = idToDisable.split("_"); if (splitID[3] == 0 && splitID[5] == 0){ alert(splitID[3]+splitID[5]); $(this).unbind('click'); }else{ }});
I've tried some methods mentioned in other topics here, but I can't seem to get any of them to work for this specific problem I have. I'm not very experienced in javascript so I haven't been able to modify any of the other examples to work the way I need it to.
I hope the code gives you some idea of what I need even though it's a bit messy, I think most of it should be pretty self explanatory? Code:
I have some JQuery that makes an Ajax call and then adds some rows to an existing table.
function LoadDestinationTable() { $("#destinationTable tr:gt(0)"[code]...
The problem is that the only place where the click event fires is on the rows that were added when the page was 1st rendered – the th, for example.I also tried adding an onclick event handler to the input button’s creation – that also does not fire.