Hi Luis,
Thanks for using Syncfusion products.
Query: “search specific row”
From your query, we understood that you need to search a record and navigate to that page and select that record during the initial rendering itself. We have achieved your requirement using dataBound event gotoPage and selectRows method of ejGrid.
Refer the below code example
$(function () {
$("#Grid").ejGrid({
// the datasource "window.gridData" is referred from jsondata.min.js
dataSource: window.gridData,
allowPaging: true,
dataBound: function(args){
var rowIndex = args.model.dataSource.findIndex(x=>x.CustomerID == "WANDK"); //find the index of the value from dataSource
var page = rowIndex / this.model.pageSettings.pageSize; // calculate its page number
if(page > 1)
this.gotoPage(Math.ceil(page)); // navigate to that page
this.selectRows(rowIndex % this.model.pageSettings.pageSize); // selcet the record using its index
},
columns: [
. . . . . . .
]
});
}); |
From the dataSource we have found that index of the particular record and found the page using that value. We have navigated to that page using gotoPage() method and selected the row using selectRows() method
For your convenience we have prepared a JS playground sample
Refer our API documentation for your reference
Note: provided solution will work only for local data, if you are using remote data or adaptor please get back to us more details regarding your dataSource.
Regards,
Vignesh Natarajan