DHTMLX Docs & Samples Explorer

getSelected (as_array)

Required library edition: This method works with any edition of DHTMLX library

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.