setSelectedReturns: grid

Select a row from the grid based on id parameter.

Parameters

NameTypeDescription
id {string} The id of the row that needs to be selected

Examples

sample

    
 <input type="text" id="txtNumber" value="1" />
 <button id="btnSelect" class="gj-button-md">Select</button>
 <br/><br/>
 <table id="grid"></table>
 <script>
     var grid = $('#grid').grid({
         dataSource: '/Players/Get',
         columns: [ { field: 'ID', width: 56 }, { field: 'Name' }, { field: 'PlaceOfBirth' } ],
         selectionMethod: 'checkbox'
     });
     $('#btnSelect').on('click', function () {
         grid.setSelected(parseInt($('#txtNumber').val(), 10));
     });
 </script>