O'Reilly logo

jQuery UI Cookbook by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating sortable menu items

The menu widget, by default, preserves the order of the listed elements used to create the menu items. It means that if the creator of the HTML used in the menu widget were to change the ordering, this would be reflected in the rendered menu. This is good for the developers because it gives us control over how we would like the items to be presented to the user. But, perhaps the user has a better idea on how the menu items should be ordered.

By combining the menu widget with the sortable interaction widget, we can provide the user with that flexibility. However, with this new capability, we will have to address another question; preserving the order chosen by the user. It is great if they can arrange the menu items ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required