ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: EPM Solutions on November 24, 2017, 01:04:23 pm
-
Hello Support Team,
We want to update some columns data dynamically and want to update changed data in our list.
For Example: On Load We have data in the grid like below
Revenue Profit
270 95
50 83
And we have added a “Add” button on click add we increase the data by 10.
After Click on add button data in the grid looks like below.
Revenue Profit
280 105
60 93
Now we want to save the new data in the list so we added one new button “Save” For Save data in the list. But When we try to get changes in the grid it is showing 0.
For Reference, we created a JSFiddle, please find URL For JSFiddle.
JSFiddle URL: http://jsfiddle.net/z4tgp9no/4/
(In JSFiddle Click On ‘Add +10’ Button And then click on Save Button)
So Please tell me how can we make fields dirty dynamically.
Please find below attached screenshot.
Please Give your feedback on this ASAP.
-
You need to use updateRow() method instead of directly making the changes in fields.
Please check this: http://jsfiddle.net/z4tgp9no/5/
type: 'button',
label: 'Add +10',
listener: function() {
var pdata = this.pageData(),
rowList = [];
console.log(pdata);
pdata.forEach(function(rd, ri) {
rowList.push({
rowIndx: ri,
newRow:{revenues: rd.revenues+10, profits: rd.profits+10}
})
})
this.updateRow({
rowList: rowList
})
}
-
Hello Team,
Thanks for your quick response.
we implement code as suggested in our code and it gives some error that dataIndx is Not defined.
Please see the attached screenshot for reference.
-
rowList.push({
rowIndx: d.pq_ri,
newRow: d
})
Looks like d is rowData; this is incorrect. newRow should contain new field values instead of pointing to existing old row "d".
-
Hello Team,
We updated the code again, Before we are using complete row data but now we set only the new values and still it gives same error.
Please find attached screenshot for reference.
-
Please post the colModel definition.
dataIndx in colModel should match the field names in newRow.