[index.html page]
<div id="jsonGrid"></div>
<script>
var jsonString = {
"allowPaging": true,
"columns": [
{
"field": "OrderID",
"headerText": "Order ID",
"textAlign": "Right",
"width": "120"
},
{
"field": "CustomerID",
"headerText": "Customer Name",
"width": "150"
},
{
"field": "OrderDate",
"format": "yMd",
"headerText": "Order Date",
"textAlign": "Right",
"width": "130"
},
{
"field": "Freight",
"format": "C2",
"headerText": "Freight",
"textAlign": "Right",
"width": "120"
},
{
"field": "ShippedDate",
"format": "yMd",
"headerText": "Shipped Date",
"width": "140"
},
{
"field": "ShipCountry",
"headerText": "Ship Country",
"width": "150"
}
],
"dataSource": ej.data.DataUtil.parse.isJson([
{
"OrderID": 10001,
"CustomerID": "ALFKI",
"EmployeeID": 1,
"Freight": 2.3,
"ShipCity": "Berlin",
"OrderDate": "1991-05-15T00:00:00",
"ShipName": "Simons bistro",
"ShipCountry": "Denmark",
"ShippedDate": "1996-07-16T00:00:00",
"ShipAddress": "Kirchgasse 6"
},
. . .
]),
"frozenColumns": 0.0,
"frozenRows": 0.0,
"pageSettings": {
"currentPage": 1.0,
"pageCount": 5.0,
"pageSize": 12.0
},
"selectedRowIndex": -1.0
};
var GridModel = new ej.grids.Grid(jsonString);
GridModel.appendTo("#jsonGrid");
</script>
|