Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Making WebFX sortable table to work in IE

Reply
Thread Tools

Making WebFX sortable table to work in IE

 
 
Andrus
Guest
Posts: n/a
 
      07-02-2003
I try to use sortable DHTML table from
http://www.webfx.eae.net/dhtml/sorta...abletable.html

Unfortunately, it does not work correctly in IE due to IE bug.

To reproduce:

1. Run the code from the end of this message in IE.
2. Click in the Price column

Observed result:

Sort icon appears in Item column

Expected result:

Sort icon must appear in Price column

Script autor wrote:

It is a bug in IE. The script works fine in all browsers except IE. The bug
in
IE is that cellIndex returns incorrect values when you hide cells.

From W3C:

cellIndex of type long, readonly
The index of this cell in the row, starting from 0. This index
is in document tree order and not display order.

From MSDN:

Collection indexes are in the source order of the HTML document.
IE does not even follow the MSDN documentation.


Script author refuses to fix it.
He recommands the following fix:

Create a function that looks something like this (too slow to be used in the
regular case)

function getCellIndex(c) {
if (ie)
LOOP and check display
else
return c.cellIndex
}

Unfortunately, I'm new to javascript to implement this.
Can anybody fix this bug and create a modified sortabletable.css file ?

Code to reproduce the problem.
you should also load sortabletable.js and sortabletable.css files from
http://www.webfx.eae.net/dhtml/sorta...abletable.html

<script type="text/javascript" src="sortabletable.js"></script>
<link type="text/css" rel="StyleSheet" href="sortabletable.css" />
<table class="sort-table" id="table-1" cellspacing="0">
<thead>
<tr>
<td style="display:none">id</td>
<td>Item</td>
<td>Price</td>
</tr>
</thead>
<tbody>
<tr>
<td style="display:none">3</td>
<td>apple</td>
<td>5</td>
</tr>
<tr>
<td style="display:none">2</td>
<td>orange</td>
<td>15</td>
</tr>

</tbody>
</table>

<script type="text/javascript">
var st1 = new SortableTable(document.getElementById("table-1"));
</script></body></html>




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NetBeans Application with sortable Table and pre-existing frame/table code clusardi2k@aol.com Java 6 07-25-2012 04:31 PM
sortable table in python 3.0 Peter Pei Python 1 02-08-2009 06:30 PM
Sortable Java Tree Table yccheok Java 1 12-27-2007 11:31 PM
Again: 2D-Array/Table but sortable asc/desc by column for different datatypes Henri =?ISO-8859-15?Q?Schom=E4cker?= C++ 1 12-17-2005 02:47 PM
Sortable Table dmsc17454_2 Javascript 3 07-16-2004 05:51 PM



Advertisments