ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: shldbapp on March 24, 2015, 08:46:52 pm
-
I want to update the current selected row with the following function:
...
change: function (event, x) {
var userInput = Data.areas[0].label;
var currentRow = ui.rowIndx;
console.log(currentRow);
$grid.pqGrid("updateRow", { rowIndx: currentRow, row: { 'Area': userInput } });
$grid.pqGrid("refreshRow", { rowIndx: currentRow });
}
...
console.log gives me the correct row number, but the function doesn't work. How to solve this?
-
your code would lead to max call stack exceeded error, updateRow would lead to change event and so on. Provide a custom source parameter as shown in the code below
change: function(evt, ui){
if(ui.source=='ms'){
return;
}
$(this).pqGrid("updateRow", { rowIndx: rowIndx, row: { 'profits': Math.random() }, source:'ms' });
}
http://jsfiddle.net/b6b710mz/69/
-
Thanks for the quick reply!
I updated the code to:
change: function(evt, ui){
if(ui.source=='ms'){
return;
}
var userInput = Data.areas[0].label;
var current_row = ui.rowIndx;
$(this).pqGrid("updateRow", { rowIndx: current_row, row: { 'Area': userInput }, source: 'ms' });
},
Result:
"Cannot call methods on pqGrid prior to initialization; attempted to call method 'updateRow'"
-
Please provide a small sample of your issue in this jsfiddle.
http://jsfiddle.net/b6b710mz/69/