$("#Grid").ejGrid({ dataSource: [],
allowPaging: true,
editSettings: {llowEditing: true, allowAdding: true, allowDeleting: true},
toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add]}, columns: [ { field: "OrderID", defaultValue: 10249, isPrimaryKey: true, headerText: "Order ID", },
{field: "CustomerID", defaultValue: "VICTE", headerText: 'Customer ID', width: 80} , . . . . ] |
$("#Grid").ejGrid({ dataSource: window.ordersView, toolbarClick: function (args){ if(args.itemName =="Add"){ //Based on some conditions here we can update values this.model.columns[1].defaultValue="VICTE"; //CustomerID column } }, editSettings: {allowEditing: true, allowAdding: true, allowDeleting: true }, toolbarSettings: {showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add] }, columns: [ { field: "OrderID", isPrimaryKey: true, headerText: "Order ID",width: 90 }, {field: "CustomerID",headerText: 'Customer ID', width: 80 }, . . . . ] |