returns the currently selected ID
string|number getSelected(boolean as_array);
| as_array||boolean||true, to force the return value to be an array|
|string|number||currently selected id|
var id = myList.getSelected();
- if the multiselection is enabled and multiple items are selected, this method will return an array of IDs;
- "as_array" parameter makes sense in multiselection mode, where a method may return a single value or an array based on selection state.
By using the "as_array" parameter you will always receive an array as the result of the method, which can simplify further processing.
Back to top