setSelected Returns: void
Select a row from the grid based on id parameter.
Parameters
Name | Type | Description |
---|---|---|
id | {string} | The id of the row that needs to be selected |
Examples
<input type="text" id="txtNumber" value="1" />
<button id="btnSelect">Select</button>
<br/><br/>
<table id="grid"></table>
<script>
var grid = $("#grid").grid({
dataSource: "../Grid/GetPlayers",
columns: [ { field: "ID" }, { field: "Name" }, { field: "PlaceOfBirth" } ],
selectionMethod: "checkbox"
});
$("#btnSelect").on("click", function () {
grid.setSelected(parseInt($("#txtNumber").val(), 10));
});
</script>