JavaScript
var getRows = function () {
// all data coming irrect
var grid = $("#list");
var myData = grid.jqGrid('getGridParam', 'data');
console.log("grid.jqGrid('getGridParam', 'data');");
console.log(myData);
//shows only first page filtered data
}
var getRows1 = function () {
//shows only first page filtered data
var grid = $("#list");
var myData = grid.jqGrid('getRowData');
console.log(" grid.jqGrid('getRowData');");
console.log(myData);
}
var mydata = [{
id: "1",
invdate: "2010-05-24",
name: "test",
note: "note",
tax: "10.00",
total: "2111.00"
}, {
id: "2",
invdate: "2010-05-25",
name: "no",
note: "note2",
tax: "20.00",
total: "320.00"
}, {
id: "3",
invdate: "2007-09-01",
name: "test3",
note: "note3",
tax: "30.00",
total: "430.00"
}, {
id: "4",
invdate: "2007-10-04",
name: "test4",
note: "stuff",
tax: "10.00",
total: "210.00"
},
{
id: "5",
invdate: "2007-10-04",
name: "test5",
note: "stuff",
tax: "10.00",
total: "210.00"
}, {
id: "6",
invdate: "2007-10-04",
name: "test6",
note: "stuff",
tax: "10.00",
total: "210.00"
}, {
id: "7",
invdate: "2007-10-04",
name: "test",
note: "stuff",
tax: "10.00",
total: "210.00"
},
];
jQuery("#list").jqGrid({
data: mydata,
datatype: "local",
height: 150,
rowNum: 5,
rowList: [10, 20, 30],
colNames: ['Inv No', 'Date', 'Client', 'Amount', 'Tax', 'Total', 'Notes'],
colModel: [{
name: 'id',
index: 'id',
width: 60,
sorttype: "int"
}, {
name: 'invdate',
index: 'invdate',
width: 90,
sorttype: "date",
formatter: "date"
}, {
name: 'name',
index: 'name',
width: 100
}, {
name: 'amount',
index: 'amount',
width: 80,
align: "right",
sorttype: "float",
...