Performance / Paging

Home

View Code

	

	<div id="page" data-role="page" data-theme="b">
    ...
		<table id='grid'></table>
		<div id='pager'></div>

		

		<script type='text/javascript'>
		jQuery('#grid').jqGrid({
			hoverrows:false,
			"viewrecords":true,
			"jsonReader":{"repeatitems":false,"subgrid":{"repeatitems":false}},
			"gridview":true,
			"url":"data.json",
			"loadonce": true,
			"rowNum":10,
			"height":200,
			"autowidth":true,
			"sortname":"OrderID",
			"rowList":[10,30,40],
			"datatype":"json",
			"colModel":[
				{"name":"OrderID","index":"OrderID","sorttype":"int","key":true,"editable":true},
				{"name":"OrderDate","index":"OrderDate","sorttype":"datetime","formatter":"date",
					"formatoptions":{"srcformat":"Y-m-d H:i:s","newformat":"m/d/Y"},
					"search":false,"editable":true
				},
				{"name":"ShipName","index":"ShipName","sorttype":"string","classes":"ui-ellipsis","editable":true}
			],
			"pager":"#pager"
		});
		// Toolbar searching
		jQuery('#grid').jqGrid('filterToolbar',{"stringResult":true});
		...
		</script>
	</div>