JQuery :: Cannot Get Columns With Rowspan To Not Be Included In Sorting (Tablesorter 2.0)
Aug 21, 2009
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've implemented tablesorter in my page using links to do the sorting rather than table headers. The reason being that the visible columns have the data in such a way that sorting on them is non-intuitive (the first column has both a job title and department title, so how to specify to sort on one or the other? I created hidden columns one for each data element and hid them).This works beautifully in Firefox and webkit browsers, but IE 7 and 8 are returning the following error when trying to sort on a hidden column that isn't the last column in the table. If I display a column, the sorting works fine on it, but hidden and not last, it errors. Changing the order of the hidden columns doesn't change the behavior, last column works and the other three error.Line: 552Error: 'undefined' is null or not an object.the line is referring to jquery.tablesorter.js here:
function setHeadersCss(table, $headers, list, css) { // remove all header information
I'm using the tablesorter plugin and having a heck of a time creating a parser to sort a column of images. One of my columns can have one of three images whose HTML code is below:
Now using the example of custom parsers from tablesorter's website, I attempted to create my own parser as seen below:
<script type="text/javascript" id="js"> // add parser through the tablesorter addParser method $.rides.addParser({ // set a unique id
[Code]....
However this code does not work. Every other column is sortable so I know the script itself is working but the column with the images refuses to sort. I also tried using regex to change the images into a sortable number for the script to use but that did not seem to work either.
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 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.
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 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
I need to be able to create a 2 column table and then based on which column header is clicked on, sort the list by that column so that each table row is sorted properly. If possible there might be more than one line in the row and I would only want to sort on the first line in a given row. Can this be done using JavaScript. If so, which entities do I need (A table? A form?)
When a thead contain less columns than real columns in the tbody section, the Tablesorter plugin produces a variable not found error in jquery coreTo reproduce simply do not put all <th> in thead that correspond to columns in tbody.
using the fixedheadertable.js plugin I bumped into what looks likes an underlying bug of Jquery. Atextarea in a rowspaned cells doesn't fill the subsequent rows ; except if a arbitrary string (a single character do)is put before the textarea. The following spans correctly the 5 rows (taken from the demo test.html of the plugin.the html is very simple and looks valid):
I am trying to create a tree table (javascript code was adopted from online source) but the rowspan in td tag does not work well when I toggle the rows. Here is the sample code, notice the row "4" should be in the Type 1 section (click on the arrow and expand it, it will display correctly), but when it is collapsed, it is pushed downwards to Type 2 section. Could not figure out what is the reason. Any ideas? Code:
I have an html table with six rows and two columns. I have what it is supposed to look like here. But, what is really confusing me is that with the exact same source code snippet inside wordpress here is not displaying the same output, the image does not span both rows? I am super confused by this behaviour. Has anybody ever run across this error before?
what I mainly want to do is to get the div's content and pass it in a variable. To explain what I have done until now :
I have my php file that contains the code :
<?php $connect = mysql_connect("localhost", "...","...") or die("Could not connect to the database."); mysql_select_db("...") or die("Could not find database <...>");
[Code]....
As I have read here, this should have done mydata="6" (is the current result)?
using the ajax function ($.ajax()) to send the value of a textarea to an php file. This works fine. But the data, which i`m sending to to the php file, is without any line-breaks.Here is my ajax request:
var myTextareaVal = $('#message-textarea').val(); $.ajax({ type: "GET",
I'm in the process of building this Ballroom Dancing website that has a simple dropdown menu. The menu works if I immediately call jQuery right above the javascript for the menu, ie:
The problem is that I don't want to do this because I already have WordPress calling jQuery several lines above for some other plugins. Is there a reason why it will only work with jQuery included right above? You can visit the site at www.zumbasudbury.ca to see the non-working dropdown. Hovering over Ballroom should produce a dropdown of two items.