ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: joaosales on March 19, 2018, 03:44:22 pm
-
Hi,
is there a way to set a set the same formula as dataIndx for multiple columns, but have the formula use a condition depending on the column?
example:
["RandomFormula", function(ui){
var total = 0;
for (var k in ui) {
if (!isNaN(ui[k])) {
if (k.indexOf("-") > 0) total += ui[k];
}
}
if(column X) total = total/10;
if(column Y) total = total*10;
}]
I'm trying to build the table dynamically , so i would need extra information about the column, other than the dataIndx, to know how to calculate.
Thanks,
-
Same function can be used for multiple formulas by using a named function instead of anonymous function.
[[dataIndx1, fn], [dataIndx2, fn2],...]
2nd parameter to the function is column which can help you get column specific information inside the function.
function fn(rowData, column){
..
}