DHTMLX Docs & Samples Explorer

Index
dhtmlxdataview
API Methods

## getSelected (as_array)

Required library edition:

Required library file: dhtmlxdataview.js

Returns currently selected ID. If mutliselection is enabled and mutliple items are selected, this method will return array of IDs

- as_array - forces return value to be an array

       var id = view.getSelected();

as_array parameter has sense in multiselection mode, where method may return a single value or an array based on selection state. By using as_array parameter you will always receive an array as the result of the method , which can simplify further processing.