This topic is locked
[SOLVED]

spreedsheet mode CALCULATIONS ON THE FLY

4/6/2021 3:21:06 PM
PHPRunner General questions
C
chrispa author

Good day , i am using phprunner build 36929

in spreedsheet mode i am trying to add calcs on the fly .

in the list page on java load event i use :

var ctrlForeignUnitFinal = Runner.getControl(pageid, 'ForeignUnitFinal');
var ctrlNewQuantity = Runner.getControl(pageid, 'NewQuantity');
var ctrlForeignTotal = Runner.getControl(pageid, 'ForeignTotal');

function func() {
ctrlForeignTotal.setValue(Number(ctrlForeignUnitFinal.getValue()) * Number(ctrlNewQuantity.getValue()));
};

ctrlForeignUnitFinal.on('keyup', func);
ctrlNewQuantity.on('keyup', func);

but is does not look to work

can you assist ?

thanks in advance

jadachDevClub member 4/6/2021

Do your calculations in the sql editor and show result in read only. That will work

C
chrispa author 4/7/2021

thanks it did not worked pls see below image - if you can assist further would be appreciate it thanks

admin 4/7/2021

The advise was to use calculations in the SQL query and default values have nothing to do with it.

In either case, we have three options to perform calculations and this explains them all:
How to use calculated fields

C
chrispa author 4/7/2021

thanks will that options works with spreedsheet mode ?

thanks

admin 4/7/2021

Yes, it will, this is why I'm suggesting it.