Skip to main content

Search and Top Navigation

#9701 closed feature (fixed)

Opened December 09, 2013 10:39PM UTC

Closed December 18, 2013 06:31PM UTC

Last modified December 18, 2013 08:35PM UTC

Menu: Ability to prevent generation of dividers from items

Reported by: fnagel Owned by:
Priority: blocker Milestone: 1.11.0
Component: ui.menu Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

In Selectmenu we need a way to show empty options. Currently the empty items (li elememts rendered by Selectmenu widget) will be processed as dividers.

Any ideas how to solve this?

Please see Selectmenu visual test for a demo.

Attachments (0)
Change History (7)

Changed December 10, 2013 02:13PM UTC by scottgonzalez comment:1

summary: Need a way in Menu to prevent empty items to be rendered as dividersMenu: Ability to prevent generation of dividers from items
version: git1.10.3

Changed December 17, 2013 06:39PM UTC by jzaefferer comment:2

Changed December 17, 2013 07:19PM UTC by fnagel comment:3

I played a little with this and it's possible to display an empty option by adding a special "empty" class and exclude this by using options.items. It's similar to adding "ui-menu-item" class to empty options: the empty items will be displayed but not processed (no generated id, ...).

These are the relevant lines:

https://github.com/jquery/jquery-ui/blob/bc8e75059c7a222ede8f5fddd88098581e5ee3ce/ui/jquery.ui.menu.js#L307-L316

Changed December 18, 2013 05:27PM UTC by scottgonzalez comment:4

milestone: none1.11.0
priority: minorblocker
status: newopen

Let's move https://github.com/jquery/jquery-ui/blob/bc8e75059c7a222ede8f5fddd88098581e5ee3ce/ui/jquery.ui.menu.js#L313 into a method named _isDivider() so that it can be overridden.

We'll also need to document this as an extension point for 1.11.

Changed December 18, 2013 06:31PM UTC by Felix Nagel comment:5

resolution: → fixed
status: openclosed

Menu: Add _isDivider method

Ability to prevent generation of dividers from items

Fixes #9701

Changeset: a6806ab17a9a5b332dc7d0c947a0a7a512dc2579

Changed December 18, 2013 06:31PM UTC by Felix Nagel comment:6

Selectmenu: Fix empty option processing

Ref #9701

Changeset: 3dfa08f22753074ce8d873b68cdc1341161f70be

Changed December 18, 2013 08:35PM UTC by scottgonzalez comment:7