$("#Grid").ejGrid({ // the datasource "window.gridData" is referred from jsondata.min.js dataSource: window.gridData, allowPaging: true, editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true }, 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, width: 90 }, { field: "CustomerID", headerText: 'Customer ID', width: 90 }, { field: "EmployeeID", headerText: 'Employee ID', textAlign: ej.TextAlign.Right, width: 80, format: "{0:n0}" }, { field: "Freight", headerText: 'Freight', textAlign: ej.TextAlign.Right, editType: ej.Grid.EditingType.Numeric, editParams: { decimalPlaces: 3 }, format: "{0:n2}", validationRules: { required: true, min: 10.2, max: 10000.000 }, width: 80 }, { field: "ShipName", headerText: 'Ship Name', width: 150 }, { field: "ShipCountry", headerText: 'Ship Country', editType: ej.Grid.EditingType.Dropdown, width: 90 } ] |
columns: [
. . .
{ field: "Freight", headerText: 'Freight', textAlign: ej.TextAlign.Right, editType: ej.Grid.EditingType.Numeric, editParams: { decimalPlaces: 3 }, format: "{0:n2}", validationRules: { required: true, min: 10.2, max: 10000.000 }, width: 80 },
] |
columns: [
. . .
{ field: "Freight", headerText: 'Freight', textAlign: ej.TextAlign.Right, editType: ej.Grid.EditingType.Numeric, editParams: { decimalPlaces: 3 }, format: "{0:n2}", validationRules: { required: true, min: 10.2, max: 10000.000 }, width: 80 },
] |
$("#Grid").ejGrid({ // the datasource "window.gridData" is referred from jsondata.min.js dataSource: window.gridData, columns: [ . . . .
{ field: "Freight", headerText: 'Freight', textAlign: ej.TextAlign.Right, editType: ej.Grid.EditingType.Numeric, editParams: { decimalPlaces: 3 }, format: "{0:n2}", validationRules: { required: true, min: 10.2, max: 10000.000 }, width: 80 },
], queryCellInfo: function (args) { var value = args.text.replace(",", ""); var $element = $(args.cell); if (args.column.headerText == "Freight" && parseFloat(value) == 32.38) $element.text(Globalize.format(parseFloat(value), "n6"));
|