From e2b7e07c585dd5c1d692bfe8f720e9cc2016b873 Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Thu, 7 Aug 2014 09:37:58 -0400 Subject: [PATCH] Selectmenu: Documenting `renderItem()` extension point --- entries/selectmenu.xml | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/entries/selectmenu.xml b/entries/selectmenu.xml index 18055590..fc4616f1 100644 --- a/entries/selectmenu.xml +++ b/entries/selectmenu.xml @@ -119,6 +119,50 @@ Returns a jQuery object containing the button element. + + + +

Method that controls the creation of each option in the widget's menu. The method must create a new <li> element, append it to the menu, and return it.

+
+ + The <ul> element that the newly created <li> element must be appended to. + + + + Whether the item is disabled. + + + A reference to the item's original <option> element. + + + The numeric index of the item. + + + The string to display for the item. + + + If the item is within an <optgroup>, this is set to that <optgroup>'s label. + + + The value attribute of the item's original <option>. + + + + Add a jQuery UI icon to any item who's <option> element has a data-icon attribute. + " ) + .append( item.label ) + .css( "padding-left", "1.5em" ); + li.append( "" ) + .find( "span" ) + .addClass( "ui-icon " + item.element.attr( "data-icon" ) ); + return li.appendTo( ul ); +} +]]> + +
+
A simple jQuery UI Selectmenu