ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: rgorantla on October 13, 2014, 09:27:30 pm
-
Rendering Cells not working when i am pasting cells.
obj.cellSave = function (evt, ui) {
$(this).pqGrid('refreshRow', { rowIndx: ui.rowIndx });
var ratesarray = ["rateeeonly", "rateeeplusoneonly", "rateeeplus2", "rateeepluschildren", "rateeeplusspouse", "rateeefamily"];
var contributionsarray = ["contreeonly", "contreeplusoneonly", "contreeplus2", "contreepluschildre", "contreeplusspouse", "contreefamily"]
if (!($.inArray(ui.dataIndx, ratesarray) == -1)) {
ratevalidations(ui);
$(this).pqGrid("refreshCell", { rowIndx: ui.rowIndx, dataIndx: ui.dataIndx });
}
if (!($.inArray(ui.dataIndx, contributionsarray) == -1)) {
contributionvalidations(ui);
$(this).pqGrid("refreshCell", { rowIndx: ui.rowIndx, dataIndx: ui.dataIndx });
}
};
contributionvalidations(ui) and rateContribution assign colors based on values entered..
Since save key is tab - when you tab on that cell it works - but when you try to paste colors are not displayed .
I need this to be Fixed ASAP . can you please help ?
-
cellSave event is executed only after inline editing a cell, it doesn't execute after paste of data, undo, redo, etc.
Please choose change event to make any changes after change in data in grid as shown in this example: http://paramquery.com/pro/demos/editing_instant
Reference:
http://paramquery.com/pro/api#event-cellSave
http://paramquery.com/pro/api#event-change
-
Still the same :
I tried all possible events
obj.change = function (evt, ui) {
var ratesarray = ["rateeeonly", "rateeeplusoneonly", "rateeeplus2", "rateeepluschildren", "rateeeplusspouse", "rateeefamily"];
var contributionsarray = ["contreeonly", "contreeplusoneonly", "contreeplus2", "contreepluschildre", "contreeplusspouse", "contreefamily"]
if (!($.inArray(ui.dataIndx, ratesarray) == -1)) {
ratevalidations(ui);
}
if (!($.inArray(ui.dataIndx, contributionsarray) == -1)) {
contributionvalidations(ui);
}
};
-
Please share your implementation via a jsfiddle.
There is no ui.dataIndx in change callback, please check the API and modify your code accordingly.
-
but i need dataindx - and if the dataindex is one of those - call the functions.
http://jsfiddle.net/rgorantla/Ljd57c1k/1/
-
dataIndx ( one or more than one ) are available in change event as keys of ui.rowList[].newRow object.
var rowList = ui.rowList;
for (var i = 0; i < rowList.length; i++) {
var obj = rowList[i],
rowIndx = obj.rowIndx,
newRow = obj.newRow,
type = obj.type,
rowData = obj.rowData;
for(var dataIndx in newRow){
if (!($.inArray( dataIndx, ratesarray) == -1)) {
ratevalidations( { dataIndx: dataIndx, rowIndx: rowIndx, ..... } );
}
}
}
-
I am trying to get the propery of newRow not the value ... May be i am missing something...
As you have seen in jsfiddle , i need the exact cell name inorder to call wither of the functions not the value of the call , like below ... Can you help me how to get this implemented in change event?
if (!($.inArray(ui.dataIndx, ratesarray) == -1)) {
ratevalidations(ui);
}
if (!($.inArray(ui.dataIndx, contributionsarray) == -1)) {
contributionvalidations(ui);
}
-
Please check the updated code for dataIndx in previous post.
-
never mind -Took another apporach ... Thanks