[Script]
<script>
// the datasource "window.gridData" is defined for grid
window.gridData = [
{ "OrderID": 10001, "CustomerID": 101, "Freight": "Chicago" },
{ "OrderID": 10002, "CustomerID": 102, "Freight": "San Francisco" },
{ "OrderID": 10003, "CustomerID": 103, "Freight": "New York" },
]
</script>
创建初始化网格控件,如下图代码实例中的div元素:
来自 window.gridData 的本地存储数据可以通过网格数据源的初始化来实现,你可以参考下面的代码实例:
[Script]
<script>
$(function () {
$("#mobgridfilter").ejmGrid({
dataSource: window.gridData, //Datasource referred here
columns: [
{ field: "OrderID", headerText: "Order ID" },
{ field: "CustomerID", headerText: "Customer ID" },
{ field: "Freight", headerText: "Freight" }
],
actionComplete: function () { $("#samplescroll").ejmScrollPanel("refresh"); }
});
});
</script>