function onSelect(args) {
let ID: string = args.nodeData.id;
if (ID === "2" || ID === "4" || ID === "9" || ID === "13") {
let data1 = new DataManager(employeeData as JSON[]).executeLocal(new Query().take(15));
grid.dataSource = data1;
grid.columns = [
{ field: 'EmployeeID', headerText: 'Employee ID', textAlign: 'Right' },
{ field: 'FirstName', headerText: 'Name' },
{ field: 'Title', headerText: 'Title' },
]
}
} |
var gridObj;
function onCreate(args) {
gridObj = new ej.grids.Grid({
dataSource: employeeData,
columns: [
{ field: 'EmployeeID', headerText: 'Employee ID', textAlign: 'Right', width: 125 },
{ field: 'FirstName', headerText: 'Name', width: 125 },
{ field: 'Title', headerText: 'Title', width: 180 },
]
});
gridObj.appendTo('#grid')
} |