Jump to content

Menu Ordering - Arrow or Drag and Drop


paulferree

Recommended Posts

Hello,

 

I'm trying to create a sort order for a menu system without using simple input boxes with numbers.

 

I think what's practical is Arrow ordering, however, I would love to incorporate some kind of drag and drop system.  Know of anything that can do that and cooperate with a MySQL db without too much crazy coding.

 

As far as the arrow ordering...I want to make sure I'm not over analyzing the issue.  So can someone help me with the concept?

 

Basically...as I see it.

 

-When a user clicks on an "up" arrow for instance. A URL variable is sent and notifies the script that we're doing a sort order change.

 

-The script then finds the current position of the menu item.

 

-It will set the current position to [current position - 1]

 

-Next I have to add 1 to every other menu item's sort order that is "behind" it.

 

Sounds a little long hand...but that's how I see it in my head...anything better, or even an online tutorial? 

 

 

Thanks,

Paul

 

Link to comment
https://forums.phpfreaks.com/topic/119692-menu-ordering-arrow-or-drag-and-drop/
Share on other sites

Well, I found a solution and it's pretty slick if you can get it to work...it didn't work well for me "out of the box" and I had to do a few more tricks to make it write to the database correctly.  But, I have it working 100% now and I love it.

 

But here it is:

 

http://www.gregphoto.net/sortable/

 

Paul

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.