JQuery Grid
Set the virtualmode property of the jqxGrid. Author: http://jqwidgets.com
by jqwidgets
HTML
<script src="http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/generatedata.js"></script>
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<div id='jqxWidget'>
<div id="jqxgrid">
<script>
function deleteRow(row) {
$("#jqxgrid").jqxGrid("deleterow", row);
}
</script>
</div>
</div>
JavaScript
var source = {
datatype: "json",
datafields: [{
name: 'name',
type: 'string'
}, {
name: 'id',
type: 'integer'
}],
root: "data",
id: "id",
url: "http://google.com",
sort: function () {
$("#jqxgrid").jqxGrid('updatebounddata', 'sort');
console.log("sorting");
return true;
},
deleterow: function (row, commit) {
console.log("source delete row: " + row);
setTimeout(
function () {
commit(true);
},
100);
return true;
}
};
var dataAdapter = new $.jqx.dataAdapter(source, {
autoBind: true,
loadServerData: function (serverdata, source, callback) {
data = {
"data": [{
"name": "name 1",
"id": "1"
}, {
"name": "name 2",
"id": "2"
}, {
"name": "name 3",
"id": "3"
}, {
"name": "name 4",
"id": "4"
}, {
"name": "name 5",
"id": "5"
}, {
"name": "name 6",
"id": "6"
}, {
"name": "name 7",
"id": "7"
}, {
"name": "name 8",
"id": "8"
}, {
"name": "name 9",
"id": "9"
}, {
"name": "name 10",
"id": "10"
}, {
"name": "name 11",
"id": "11"
}, {
"name": "name 12",
"id": "12"
}, {
"name": "name 13",
"id": "13"
}, {
"name": "name 14",
"id": "14"
}],
"TotalRows": "14"
};
console.log("loadServerData");
console.log(data);
source.totalrecorde = data.TotalRows;
...