<script type="text/javascript">
$(function () {
$("#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", headerText: "Order ID", isPrimaryKey:true, textAlign: ej.TextAlign.Right, width: 65 },
{ field: "CustomerID", headerText: "Customer ID", width: 90 },
{ field: "ShipCity", headerText: "Ship City", width: 90 },
{ field: "Freight", headerText: "Freight", width: 90, textAlign: ej.TextAlign.Right, format: "{0:C}", editType: ej.Grid.EditingType.Numeric, editParams: { minValue: 0 } },
{ field: "ShipCountry", headerText: "Ship Country", width: 90 },
{ field: "EmployeeID", headerText: "Employee ID", width: 90, textAlign: ej.TextAlign.Right }
]
});
});
</script>
|