jquery - how to show all groups in first page in jqgrid? -
jquery - how to show all groups in first page in jqgrid? -
i used jqgrid asp.net mvc project. have 25000 info different section , have grouped department, each section there 500+ data. have done paging 100 info per page, problem when info load first 100 record of same section can see 1 grouping department. when finish next 5 step can see other department, requirement have show groups of section in same page when info load on expand of grouping have paging data, possible jqgrid? if yes how ? current code is
jquery("#itemsoldreport").jqgrid({ data: parsedjson, datatype: "local", height: 'auto', width: 'auto', rownum: 100, rowlist: [10, 20, 30, 50, 100], colnames: ['date', 'time', 'upc', 'name', 'department', 'qty', 'cost', 'price', 'margin'], colmodel: [ { name: 'invoicedate', index: 'invoicedate', width: 90, sorttype: "date", summarytype: 'count', summarytpl: '({0}) total', resizable: false, datefmt: "m/d/y h:i a" }, { name: 'invoicetime', index: 'invoicetime', width: 90, resizable: false }, { name: 'barcode', index: 'barcode', width: 130, resizable: false, }, { name: 'itemname', index: 'itemname', width: 150, resizable: false, }, { name: 'deptname', index: 'deptname', width: 120, resizable: false }, { name: 'itemquantity', index: 'itemquantity', width: 50, align: "right", sorttype: "int", resizable: false, }, { name: 'costprice', index: 'costprice', width: 80, align: "right", sorttype: 'number', formatter: 'number', summarytype: 'sum', resizable: false, }, { name: 'salesprice', index: 'salesprice', width: 80, align: "right", sorttype: "number", summarytype: 'sum', formatter: "number", resizable: false, }, { name: 'extendedpricemargin', index: 'extendedpricemargin', width: 50, align: "right", resizable: false, }, ], pager: "#itemsoldpager", viewrecords: true, sortorder: "desc", // caption: "item sold report", //sortname: 'deptname', grouping: true, hidegrid: false, groupingview: { groupfield: ['deptname'], groupdatasorted: false, grouptext: ['<b>{0} - {1} department(s)</b>'], groupcollapse: true, grouporder: ['asc'], groupsummary: [true], //groupsorted: false, }, footerrow: true, userdataonfooter: true, onclickgroup: function (hid, collapsed) { //savecollapsedstatetolocalstorage(hid, collapsed) var i; = $.inarray(hid, expandedgroups) > -1; if (!collapsed && == false) { expandedgroups.push(hid); } else if (collapsed && == true) { //grouphid.splice(i, 1); expandedgroups.splice($.inarray(hid, expandedgroups), 1); } }, loadcomplete: function () { var $this = $(this), //sum = $this.jqgrid("getcol", "salesprice", false, "sum"), $footerrow = $(this.grid.sdiv).find("tr.footrow"), localdata = $this.jqgrid("getgridparam", "data"), totalrows = localdata.length, totalsum = 0, totalcostsum = 0, $newfooterrow, i; (i = 0; < totalrows; i++) { totalsum += parsefloat(localdata[i].salesprice, 10); totalcostsum += parsefloat(localdata[i].costprice, 10); } $footerrow.find(">td[aria-describedby=" + this.id + "_invoicedate]") .text("grand total:"); $footerrow.find(">td[aria-describedby=" + this.id + "_salesprice]") .text($.fmatter.util.numberformat(totalsum, $.jgrid.formatter.number)); $footerrow.find(">td[aria-describedby=" + this.id + "_costprice]") .text($.fmatter.util.numberformat(totalcostsum, $.jgrid.formatter.number)); if (expandedgroups.length > 0) { (var = 0; <= expandedgroups.length; i++) { if (typeof (expandedgroups[i]) != "undefined") { $this.jqgrid("groupingtoggle", expandedgroups[i]); } } } } }); jquery("#itemsoldreport").jqgrid('navgrid', '#itemsoldpager', { add: false, edit: false, del: false }); jquery("#itemsoldreport").setgridwidth("100"); });
jquery asp.net-mvc jqgrid jqgrid-asp.net jqgrid-formatter
Comments
Post a Comment