getSelectedId

returns the selected elements ids

object|array|string getSelectedId( [boolean asArray,boolean asString] );
asArray
booleanoptional, specifies whether the returning result should be an array asString
booleanoptional, specifies whether the returning result should be a string
object|array|stringa cell/row/column id or an array of them

Example

//return ids as an array of objects
grid.getSelectedId(true);
 
//return ids as an array of strings
grid.getSelectedId(true, true);

Details

If no parameters were passed to the method, it returns the id as an object (for one selected element) or as an array of objects (for several elements).

The format of the selection result if the second parameter (asString) is false:

{ column:"votes", row:4, id:4 } // "row" selection

where:

If the "asString" parameter is set, the result value will depend on the selection mode:

See also
  • API
  • Articles
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.
    If you have not checked yet, be sure to visit site of our main product Webix ui component library and page of javascript datagrid library product.