$(function () {
$("#Grid").ejGrid({
columns: [//column template
{ { field: "EmployeeID", template: "{{:~getModel()}}", headerText: "Employee ID", isPrimarykey: true, editType: ej.Grid.EditingType.NumericEdit, textAlign: ej.TextAlign.Right, width: 90 },
{ field: "FirstName",template: "{{:~getModel()}}", headerText: "First Name", width: 90 },
]
});
});
$.views.helpers({//helper class
getModel: function () {
if (this.ctx.prop.field == "EmployeeID")
return this.ctx.root.EmployeeID;
else
return this.ctx.root.FirstName;
} }); |