var index;
$(function () {
$("#Grid").ejGrid({
dataSource: Data,
allowPaging: true,
commonWidth: 200,
enablePersistence: true,
rowSelected: "rowSelected",
actionComplete: "complete",
columns: [
{ field: "OrderID", isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, validationRules: { required: true, number: true } },
{ field: "CustomerID", headerText: 'Customer ID', validationRules: { required: true, minlength: 3 } },
]
});
});
function rowSelected(args) {
index = args.rowIndex;
}
function refreshData(){
var gridObj = $("#Grid").ejGrid("instance");
gridObj.dataSource(window.gridData);
gridObj.selectRows(index);
} |