[solved] Tablesorter plugin

BlackBird

I'm happy to hear that. Maybe you'd like to add [solved] to the subject line of the first posting. :wink:
[url=http://wbaddons.webbird.de]http://wbaddons.webbird.de[/url] [url=http://www.WebsiteBaker.org/forum/index.php/topic,27476.msg189845.html#msg189845]Don't miss this[/url]

Sander

Indeed.

Each row is a form, so the form tags can't be outside the table. Now I have a valid form nested in one <td>

I'm happy also  8-)

pcwacht

See how posting code helps us helping!!

Have fun,
John
[url="http://www.ictwacht.nl"]http://www.ictwacht.nl[/url] = Dutch ICT info
[url="http://www.pcwacht.nl"]http://www.pcwacht.nl[/url] = My first
both still work in progress, since years.....

BlackBird

Best way is to put the opening <form> before the opening <table> and close the form after </table>, if the form includes the whole table. (Did not analyze if it does in this case.)

Also, make sure to nest the HTML tags right. It's not valid to open the form in one TD and close it in another one.

INVALID
<tr><td><form..>...</td><td>...</td><td></form></td></tr>

VALID
<tr><td></td><td>...</td><td><form..>...</form></td></tr>

I'm happy you solved your problem. :-D
[url=http://wbaddons.webbird.de]http://wbaddons.webbird.de[/url] [url=http://www.WebsiteBaker.org/forum/index.php/topic,27476.msg189845.html#msg189845]Don't miss this[/url]

Sander

That does the trick!!!

Thanks a lot!!

I inserted the <form> tag in the last cell and then there's no problem. All sorter types are recognized and the table is sortable.

Thanks a lot again!

pcwacht

Set the form tags outside the tabel!

This might do the trick
Allso you can test woithout the form tags first to see if it'll work.

Good luck hunting!
John
[url="http://www.ictwacht.nl"]http://www.ictwacht.nl[/url] = Dutch ICT info
[url="http://www.pcwacht.nl"]http://www.pcwacht.nl[/url] = My first
both still work in progress, since years.....

Sander

#11
No it won't fix the problem.

It has to do with the data-type in the cells I think. Below the page where the table doesn't sort in IE8.
FF, Opera, Chrome all don't have problems with the sorting...


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
<script src="../modules/jqueryadmin/jquery-core/jquery-core.min.js" type="text/javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta name="Keywords" content=""/>
<meta name="Description" content=""/>
       <script type="text/javascript" src="../modules/jqueryadmin/plugins/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../modules/jqueryadmin/plugins/tablesorter/jquery.tablesorter.pager.js"></script>
<script type="text/javascript">
$(document).ready(function()
   {
        $("#resultaat").tablesorter({widgets: ['zebra'],
       // pass the headers argument and assign a object
       headers: {
           // assign the first column (we start counting zero)
           0: {
               // disable it by setting the property sorter to false
               sorter: false
           },
           // assign the second column (we start counting zero)
           1: {
               // disable it by setting the property sorter to false
               sorter: false
           },
           // assign the third column (we start counting zero)
           2: {
               // disable it by setting the property sorter to false
               sorter: false
           },
           // assign the sixth column (we start counting zero)
           5: {
               // disable it by setting the property sorter to false
               sorter: false
           },
           // assign the seventh column (we start counting zero)
           6: {
               // disable it by setting the property sorter to false
               sorter: false
           },
           // assign the eighth column (we start counting zero)
           7: {
               // disable it by setting the property sorter to false
               sorter: false
           },
           // assign the ninth column (we start counting zero)
           8: {
               // disable it by setting the property sorter to false
               sorter: false
           },
           // assign the tenth column (we start counting zero)
           9: {
               // disable it by setting the property sorter to false
               sorter: false
           }
       },
       debug: true
       });
   }
);
</script>
<link rel="stylesheet" href="../modules/jqueryadmin/plugins/tablesorter/blue/style.css" type="text/css" />
</head>
<body>
<table class="tablesorter" id="resultaat" width="98%">
<thead>
<tr>
<th><b>Afb.</b></th>
<th><b>Artikelnummer</b></th>
<th><b>Omschrijving</b></th>
<th><b>Bruto</b></th>
<th><b>Netto</b></th>
<th><b>Staffel</b></th>
<th><b>Vrd</b></th>
<th><b>Levertijd</b></th>
<th><b>Aantal</b></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><form action="" method="post">
   <a href="#"><img src="29500030.jpg" width="30px"></a>
</td>
<td>artikelnummer1</td>
<td><div>artikelomschrijving1</div></td>
<td>&euro; 18,00</td>
<td>&euro; 9,00</td>
<td></td>
<td>14</td>
<td align="right">Aantallen en levertijd1</td>
<td><input type="text" name="aantal" value="1" size="2" onfocus="this.select();" /></td>
<td><input type="submit" name="cart" title="Toevoegen" value="" /></form></td>
</tr>
<tr>
<td><form action="" method="post">
   <a href="#><img src="29500505.jpg" width="30px"></a>
</td>
<td>Artikelnummer2</td>
<td><div>artikelomschrijving2</div></td>
<td>&euro; 33,00</td>
<td>&euro; 16,50</td>
<td></td>
<td>2<br>17</td>
<td align="right">Aantallen en levertijd2</td>
<td><input type="text" name="aantal" value="1" size="2" onfocus="this.select();" /></td>
<td><input type="submit" name="cart" title="Toevoegen" value="" /></form></td>
</tr>
</tbody>
</table>
</body>
</html>

BlackBird

I've upgraded the plugin for JQA 2.x to be configurable in the backend. Won't fix the problem I'm afraid, but maybe helps playing around with the settings.

[gelöscht durch Administrator]
[url=http://wbaddons.webbird.de]http://wbaddons.webbird.de[/url] [url=http://www.WebsiteBaker.org/forum/index.php/topic,27476.msg189845.html#msg189845]Don't miss this[/url]

BlackBird

I think it works with the headers.

"tablesorter works on standard HTML tables. You must include THEAD and TBODY tags" (http://tablesorter.com/docs/index.html#Getting-Started)

Maybe you should take a deeper look at the Examples page to see what's "wrong" with your table.

It's a bit like "fishing in muddy waters" without having insight into the table page. :roll:
[url=http://wbaddons.webbird.de]http://wbaddons.webbird.de[/url] [url=http://www.WebsiteBaker.org/forum/index.php/topic,27476.msg189845.html#msg189845]Don't miss this[/url]

Sander

[UPDATE]

It seems like tablesorter don't recognize all columns (only the first two) of the table. So the columns which can be sorted are not recognized as built-in sorters, so that where the JS error comes from, I think.

Sander

#7
Nederlands snap ik ook wel ;-)

Het zit zoals ik het nu kan beoordelen in de soort data (platte tekst, html, formulier) die in de verschillende cellen wordt geplaatst.

In English:
I think the problem occurs because of the data type in the table cells.I have to set the textExtraction to 'complex'. Maybe that helps.. Doesn't solve the problem.

pcwacht

Maybe this page helps : http://www.scholenmarktamersfoort.nl/nieuw/pages/alle-scholen-op-een-rij.php (Dutch sorry)
There I use a jquery tablesorter, not plugged in through jquery admin though!
Used jquery files: jquery-1.2.6.min.js, jquery.tablesorter-2.0.3.js, jquery.tablesorter.filer.js, jquery.tablesorter.pager2.js

It works like a charm in every tested browser.

Can give yout he files if needed.

John
[url="http://www.ictwacht.nl"]http://www.ictwacht.nl[/url] = Dutch ICT info
[url="http://www.pcwacht.nl"]http://www.pcwacht.nl[/url] = My first
both still work in progress, since years.....

Sander

I will, but I can't find the problem yet.

Also saw the demo working on IE8.. Just have to search further..

Thanks for your answers!

BlackBird

#4
Hm. As the last version is of March 2008 (see http://tablesorter.com/changelog), while IE8 was released some time in 2009, this may causes the problem. Unfortunately, I am no JavaScript programmer, so I'm afraid I'm not able to help.

Edit: The demo page (http://tablesorter.com/docs/index.html) works with IE8. Dunno what's the problem. I did not pack this plugin for JQA. Maybe you should check the settings made in the default.preset file.
[url=http://wbaddons.webbird.de]http://wbaddons.webbird.de[/url] [url=http://www.WebsiteBaker.org/forum/index.php/topic,27476.msg189845.html#msg189845]Don't miss this[/url]

Sander

Already did that. There's still the same problem. I've searched the internet, the Tablesorter Homepage, the jQuery forum but nothing helps for now. There must be someone with the same problem I hope...

BlackBird

Try to use the plugin without jQueryAdmin to see if it is caused by the plugin itself. If it is, try to get support from the Tablesorter Homepage. http://tablesorter.com/
[url=http://wbaddons.webbird.de]http://wbaddons.webbird.de[/url] [url=http://www.WebsiteBaker.org/forum/index.php/topic,27476.msg189845.html#msg189845]Don't miss this[/url]

Sander

#1
Hi all,

Are there any known problems using the jQueryAdmin tool and the tablesorter plugin in combination with IE8?

In all other browsers the plugin works fine (Firefox, Opera, Chrome, IE6 and IE7) but in IE8 I get a Javascript error:

Error: 'type' is empty or not an object
This is an error in the jquery.tablesorter.min.js file and it is in the line:

function getCachedSortType(parsers,i){return parsers.type;};

When I run IE8 in the compatibility modus there's no problem.

Does anybody have any idea what there can be wrong?