LIVE DEMO HERESumoselect full : jquery.sumoselect.jsMinified : jquery.sumoselect.min.js A jQuery plugin that progressively enhances an HTML Select Box into a Single/Multiple option dropdown list. The dropdown list can be fully customiseable using siple css properties. It can adapt itself according to any deveice, keeping in mind that the User Experience is not broken.Notable Features
- Single and Multi select option.
- Search Support
- Optgroup support.
- Localization support.
- Fully customizable by simple css.
- Supports almost all devices (Till now i didnt found one)
- Intelligently Renders itself according to the devices.
- Renders native Single/Multiple pop up on Android, ios, Windows and other devices.
- Custom postback data format (Multiple select data can be passed either as csv or default select)
- Selected, Disabled, Select All, keyboard navigation and Placeholder Support
- Redesigned the UI (No external icons are used now and color scheme can be controlled by css)
- Easily extendable to allow developers to create new widgets
- Basic methods to handle all kinds of manipulations like adding item, remove item, disable, select etc.
RequirementsjQuery 1.8.3+ (It is always recommended to use the latest version of jQuery) Desktop Browser SupportIE8+, Firefox 4+, Chrome, Safari 4+, Opera 11+ (Other browsers may work, but I did not test on them) Mobile/Tablet Browser SupportiOs 3+, Android 2.1+ , Windows Mobile (Other browsers may work, but I did not test on them) ForkingIf you find that you need a feature that SumoSelect does not currently support, either let me know via the SumoSelect issue tracker, or fork SumoSelect on Github and easily extend SumoSelect to create your own widget! UsageTo just go with the default options simply do $(document).ready(function () $('.SlectBox').SumoSelect(); );To provide optional settings, simply pass settings object to SumoSelect() $(document).ready(function () $('.SlectBox').SumoSelect(placeholder: 'This is a placeholder',csvDispCount: 3 ); );
SettingsThe following settings are available now: Option Type Discription placeholder (string) The palceholder text to be displayed in the rendered select widget (on priority basis). *Maximum priority is given to native placeholder attribute in select tag i.e. - - Then the option with disabled and selected attribute i.e. - Last to to the given placeholder attribute in the settings. * csvDispCount (int) The number of items to be displayed in the widget seperated by a , after that the text will be warped as 3+ Selected. Set 0 for all the options. captionFormat (string) Its the format in which you want to see the caption when more than csvDispCount items are selected. its default value is'0 Selected' ( here 0 will be replaced by the seletion count ) captionFormatAllSelected (string) I Format of caption text when all elements are selected. set null to use captionFormat. It will not work if there are disabled elements in select. default is '0 all selected!' floatWidth (int) Minimum screen width of device below which the options list is rendered in floating popup fashion. forceCustomRendering (boolean) Force the custom modal ( Floating list ) on all devices below floatWidth resolution. nativeOnDevice (Array[string]) The keywords to identify a mobile device from useragent string. The system default select list is rendered on the matched device. outputAsCSV (boolean) true to POST data as csv ( false for deafault select ) csvSepChar (string) Seperation char if outputAsCSV is set to true okCancelInMulti (boolean) Displays Ok Cancel buttons in desktop mode multiselect also. isClickAwayOk (boolean) for okCancelInMulti=true. sets whether click outside will trigger Ok or Cancel (default is cancel). triggerChangeCombined (boolean) In Multiselect mode whether to trigger change event on individual selection of each item or on combined selection ( pressing of OK or Cancel button ). selectAll (boolean) To display select all check or not (default is false). selectAllPartialCheck (boolean) Display a disabled checkbox in multiselect mode when all the items are not selected (default is true). clearAll (boolean) To display "Clear all" in multiselect (default: false) closeAfterClearAll (boolean) Close dropdown after clicking on "Clear all (clearAll=true)" (default: false) search (boolean) To enable searching in sumoselect (default is false). searchText (string) placeholder for search input. searchFn (function) Custom search function. noMatch (string) placeholder to display if no itmes matches the search term (default 'No matches for "0"'). prefix (string) prefix to prepend the selected text (default is empty) eg. '
Hello'. locale (array) change the text used in plugin (['OK', 'Cancel', 'Select All', 'Clear ALL']). Note: don't break the sequence or skip items. up (boolean) the direction in which to open the dropdown (default: false) showTitle (boolean) set to false to prevent title (tooltip) from appearing (deafult: true) max (int) Maximum number of selected options (if multiple) renderLi (function) Custom
- item renderer.
The default settings are : placeholder: 'Select Here', csvDispCount: 3, captionFormat: '0 Selected', captionFormatAllSelected: ''0 all selected!'', floatWidth: 500, forceCustomRendering: false, nativeOnDevice: ['Android', 'BlackBerry', 'iPhone', 'iPad', 'iPod', 'Opera Mini', 'IEMobile', 'Silk'], outputAsCSV : false, csvSepChar : ',', okCancelInMulti: true, isClickAwayOk: false, triggerChangeCombined : true, selectAll : false, selectAllPartialCheck : true, search : false, searchText : 'Search...', searchFn : function(haystack, needle, el) ... , noMatch : 'No matches for "0"', prefix : '', locale : ['OK', 'Cancel', 'Select All'], up : 'false', showTitle : 'true', max : null, renderLi : (li, originalOption) => li, Events Sumoselect raise some very helpful events on which you can hook your custom handlers.