getSelectedId
returns the selected elements ids
function getSelectedId( // optional, specifies whether the returning result should be an array asArray?: boolean, // optional, specifies whether the returning result should be a string asString?: boolean): object|array|string
Returns
Section titled “Returns”object,array,string
a cell/row/column id or an array of them
Example
Section titled “Example”//return ids as an array of objectsgrid.getSelectedId(true);
//return ids as an array of stringsgrid.getSelectedId(true, true);
Details
Section titled “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:
- column - the column id
- row - the row id
- id - the string value of the ID (the same as if you passed asString)
If the “asString” parameter is set, the result value will depend on the selection mode:
- “row” or true - 4 (as in the dataset)
- “column” - “votes”
- “cell” - “4_votes”
See also
Section titled “See also”Articles
API