ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: omerix on October 26, 2017, 04:58:33 am

Title: Batch editing remote model
Post by: omerix on October 26, 2017, 04:58:33 am
Hello,

When I made the following changes, I pressed the "New Product" button on a 3rd page grid. The bottom line is not opening a new line.
(dataModel, pageModel)

Sample: Total records:39

Do I have to make a change here?
Code: [Select]
{ type: 'button', icon: 'ui-icon-plus', label: 'New Product', listener: function () {
//var rowData = { ProductID: 34, UnitPrice: 0.2 }; //empty row
var rowData={};
var rowIndx = grid.addRow( { rowData: rowData, checkEditable: true });
grid.goToPage({ rowIndx: rowIndx });
grid.editFirstCellInRow({ rowIndx: rowIndx });                       
}
},



dataModel:
Code: [Select]
dataModel: {
dataType: "JSON",
method: "GET",
location: "remote",
recIndx: "ID",
url: "?isl=GridGetir",
getData: function (response) {
var data=response.data;
return { curPage: response.curPage, totalRecords: response.totalRecords, data: data };
}
}

pageModel:
Code: [Select]
pageModel: {
type: "remote",
curPage: 1,
rPP: 15,
rPPOptions: [1, 5, 10, 15, 25, 50, 100, 200]
},
Title: Re: Batch editing remote model
Post by: paramvir on October 26, 2017, 04:45:24 pm
when pageModel.type is "remote" and new row is appended on any non last page, new row won't show because only rpp rows can exist on that page.

So instead of appending, try to prepend a new row ( rowIndxPage: 0 ) as in this example of remote pageModel.

Code: [Select]
grid.addRow({ rowIndxPage: 0, rowData: rowData, checkEditable: false });

https://paramquery.com/pro/demos/editing