getSelectedId

returns the id(s) of the selected item(s)

string|array getSelectedId( [boolean as_array] );
as_arraybooleanspecifies whether the result should always be returned as an array.
The default value is false
string|arraythe single item id or an array of ids

Example

//single select mode
var id = list.getSelectedId(); // id = someid
 
//multiselect mode
var id = list.getSelectedId(); // id = [someid1, someid2, someid3]

Related samples

See also
Back to top