Grid has built-in selection model, which supports single and multiple rows selection mode. You can specify if multiple selection is allowed in selection/multiple
property:
obj.setSelectionProperty("multiple", true);
The index of the last selected row is stored in selection/index
property:
var index = obj.getSelectionProperty("index");
While selection/values
property returns an array of all selected rows:
var array = obj.getSelectionProperty("values");
Grid calls selectionChanged
action so you can attach an action handler to process selection event.
obj.setAction("selectionChanged", myFunction);
Multiple selection is activated if the Ctrl key is pressed during mouse clicks.