Re: [jQuery] Performance of idrag/idrop

2006-09-12 Thread Mark Gibson
Mark Gibson wrote: Ideally I'd like to have a single Droppable on the whole table, and use the 'ondrop' callback, but having the position of the pointer (relative to the table element) passed to the callback function, is this possible? Right, I've solved it. To recap the problem: I have a

Re: [jQuery] Performance of idrag/idrop

2006-09-12 Thread Stefan Petre
Sorry but I changed that already cursx is not used anymore. I advice to use 'onDrag' callback. This way you get element's coordinates. You check this coordinates against you table position and each cell position. let's say: you have a table 500 px width, 500 height, 5 rows and 5 columns,

[jQuery] Performance of idrag/idrop

2006-09-11 Thread Mark Gibson
Hi, I've created a UI where items can be dragged from a palette and dropped into a table - using jQuery and iDrag/iDrop from Interface. So, I've made every table cell and heading ('th.td') a Droppable, so there could be hundreds of droppables, but only a small amount of draggables (ie. less than

Re: [jQuery] Performance of idrag/idrop

2006-09-11 Thread Stefan Petre
When you drag an element each droppable is interrogated until overlaps or to the end if no droppable is overlapped. If you have a large amount of drop zones in a grid with the same dimensiunos then you can use 'onDrag' and 'onDrop' callback from draggable to use mathematic rules for

Re: [jQuery] Performance of idrag/idrop

2006-09-11 Thread Mark Gibson
Stefan Petre wrote: When you drag an element each droppable is interrogated until overlaps or to the end if no droppable is overlapped. If you have a large amount of drop zones in a grid with the same dimensiunos then you can use 'onDrag' and 'onDrop' callback from draggable to use

Re: [jQuery] Performance of idrag/idrop

2006-09-11 Thread Klaus Hartl
I've had a look at idrop.js, and highlight() seems to where the delay occurs. I tried to profile the code using venkman, but can't my head round it at the minute - anyone know an easy way to profile a javascript function? you could use the excellent firebug extension: console.time('name');