Traditionally that is achieved by a doubly linked list. Each row contains a pointer to the next and previous row and a null for the end case. The linked list structure cannot fail regardless of the amount of shuffling or the size.

Sean Payne wrote:
Suppose gui-users wanted to drag and drop rows in a table so that they could shuffle it anyway that they wanted so that the rows maintained that order the next time they accessed the table. Can this be done without updating alot of other rows? How is this normally handled?

The ideas I have are
1. to use a field (possibly the primary key) and then reorder the lower part of the table each time a row is moved.
2. to deal with it a separate table - maintain an position->key table
3. do something like have an "magical-order-field" which keeps a string that when SORTed BY maintains the desired order. so to insert a row between "a" and "b" set it's magical-order-field to "aab"

Got hints?

Thanks,

SEan

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to