Dear all,
We try to add grid with javascript as follow :
ej.grids.Grid.Inject(ej.grids.Page, ej.grids.Sort, ej.grids.Filter);
grid = new ej.grids.Grid({
dataSource: ListArr,
columns: [
{ field: 'Id', headerText: 'Camera ID', width: 120, type: 'string',visible:false },
{ field: 'Name', width: 140, headerText: 'Camera Name', type: 'string' }
],
toolbar: ['Search'],
allowSorting: true,
allowPaging: true,
pageSettings: { pageSize: 20 },
rowSelected: rowSelected
});
grid.appendTo('#Grid');
function rowSelected(args) {
var selectedIndex = $.map(ListArr, function (item, index) {
return item.Id;
}).indexOf(args.data.Id);
if (currContainer === "") {
alert("error");
grid.clearSelection();
}
else
buildCameraElement(cameraArr[selectedIndex]);
}
After display the alert message, we fail to clear the selected highlight row. Please advance, thx.
KennethT