free-jqgrid / jqGrid

jQuery grid plugin
https://github.com/free-jqgrid/jqGrid
Other
478 stars 196 forks source link

Can jqgrid sends totalrows after the first pulling data? #510

Open hyfbeetle opened 1 year ago

hyfbeetle commented 1 year ago

image I want to use it on the next page action. Simple modify, Added "if (pN.totalrows !== null) { prm[pN.totalrows] = p.records; }", is it any problem? thanks very much!

            populate = function (npage) {
                var self = this, $self = $(self), gridSelf = self.grid;
                if (!gridSelf.hDiv.loading) {
                    var pvis = p.scroll && npage === false, prm = {}, dt, dstr, pN = p.prmNames;
                    if (p.page <= 0) { p.page = Math.min(1, p.lastpage); }
                    if (pN.search !== null) { prm[pN.search] = p.search; }
                    if (pN.nd !== null) { prm[pN.nd] = new Date().getTime(); }
                    if (isNaN(parseInt(p.rowNum, 10)) || parseInt(p.rowNum, 10) <= 0) { p.rowNum = p.maxRowNum; }
                    if (pN.rows !== null) { prm[pN.rows] = p.rowNum; }
                    if (pN.page !== null) { prm[pN.page] = p.page; }
                    if (pN.sort !== null) { prm[pN.sort] = p.sortname; }
                    if (pN.order !== null) { prm[pN.order] = p.sortorder; }
                    if (p.rowTotal !== null && pN.totalrows !== null) { prm[pN.totalrows] = p.rowTotal; }
                    if (pN.totalrows !== null) { prm[pN.totalrows] = p.records; }
                    var lcf = isFunction(p.loadComplete), lc = lcf ? p.loadComplete : null;
                    var adjust = 0;
                    npage = npage || 1;
                    if (npage > 1) {