Incremental Update: Re-ordering Menu Structure
Posted: Wed Feb 22, 2006 1:29 pm
hello,
im building a dynamic menu structure in which has submenus and want to be able to effeciently impliment a re-ordering system based on user selection.
i have the following menu structure
Now lets use an e.g. to explain what i want to accomplish...
lets say i want to move 4002 from position 5 to 4
pretty easy
Updating menus position based on thier submenus if any
How can i generate the (i++) on each row update
Any suggestions of improving this theory?
Kendall
im building a dynamic menu structure in which has submenus and want to be able to effeciently impliment a re-ordering system based on user selection.
i have the following menu structure
Code: Select all
ID | menu | group | parent | order
43981 | Client Success | Success |0 |1
7000 | Services | Services |0 | 2
4000| About Us | About | 0 | 3
4001 | Who We Are | About | 4000 |4
4002 | Strategic Partners | About |4000 |5
4003 | Contact Us | About | 4000 |6lets say i want to move 4002 from position 5 to 4
pretty easy
- First i update the menus between 4 and 5
- Then i update 4002 to 4
- First i update the menus between 2 and 3
- Then i update 4000 to 1
- Then update menus to 1+(i++) who is child of 4000
Updating menus position based on thier submenus if any
How can i generate the (i++) on each row update
Any suggestions of improving this theory?
Kendall