var flag = true; $(function () { $("#Grid").ejGrid({ … actionComplete : function(args){ var gridObj = $("#Grid").ejGrid("instance"); if (args.requestType == "refresh" && flag == true) { flag = false; gridObj.hideColumns("CustomerID"); } }, editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, editMode: "batch" }, toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel] }, columns: [ { field: "OrderID", isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, validationRules: { required: true, number: true }, width: 90 }, .. ] }); }); </script> </body> </html> }, |