I'm having problems getting UI code to perform at all well in IE.
I have a table - a matrix of values. Each cell can be empty or hold a list of items.
I want users to be able to drag items between cells.
So my HTML looks something like this:
<table>
<tr><td></td><th scope="col">col 1</th><th scope="col">col 2</th></tr>
<tr><th scope="row">row 1</th>
<td class="droppable-cell">
<div class="draggable-item">item A</div>
<div class="draggable-item">item B</div>
</td>
<td class="droppable-cell"></td>
</tr>
<tr><th scope="row">row 2</th>
<td class="droppable-cell"></td>
<td class="droppable-cell">
<div class="draggable-item">item C</div>
<div class="draggable-item">item D</div>
</td>
</tr>
</table>
Then I'm using jQuery 1.3.1 and jQuery UI 1.6rc6:
$j('.draggable-item').each(function()
{
$j(this).draggable({
addClasses: false,
revert: true,
zIndex: 2000,
cursor: 'move'
});
});
$j('.droppable-cell').each(function()
{
$j(this).droppable({
addClasses: false,
activeClass: 'droppable-cell-candrop',
hoverClass: 'droppable-cell-hover',
tolerance: 'pointer',
drop: function(event, ui)
{
//function to save change
});
});
});
Note that this is simplified, truncated and unfinished code.
My problem is that in FX, Safari, Chrome, etc (i.e. all the decent browsers) this works fine.
IE really struggles though. With a 5x5 table IE's delay on the start of a drag is noticeable. On a 10x10 table with maybe 100 items the start of the drag hangs the browser.
I want to be able to support up to round 20x15 cells and maybe up to 500 items - is this just impossible? It doesn't seem like it should be.
Am I doing something wrong? Is there a way to do this that doesn't slow the page in IE like this?