jquery-sortable using behavior of a linkedlist

Posted by BabaBooey on Stack Overflow See other posts from Stack Overflow or by BabaBooey
Published on 2010-06-04T15:43:43Z Indexed on 2010/06/13 1:12 UTC
Read the original article Hit count: 355

I suspect I'm not looking at this issue in the right way so here goes.

I have essentially a LinkedList of data on a web page (http://en.wikipedia.org/wiki/Linked_list) that I'd like to manipulate using traditional Linked List behavior (i.e. just updating the reference/id of the "next" object) for performance reasons.

Where this gets a bit tricky is I'd ideally like to use Jquery's sortable to do this. Like the user would drag something up/down and I could just do an Ajax call to the server with the id of the object that moved and the new parent id of that object (and then behind the scenes I could figure out how to reconnect things..maybe need more data than that...).

But every example I've seen where sortable is used they were sending the whole re-indexed list to the database to update which seems unnecessary to me. With a linked list to change an element's "index" I only need to make 3 updates which depending on the size of the list could be a big performance savings. Anyone have an example of what I'm trying to do...am I too far in left field?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui