ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: lsl on September 18, 2014, 09:32:50 am

Title: How to calculate and fill in values in other cells when a cell finished editiong
Post by: lsl on September 18, 2014, 09:32:50 am
I want to fill in the column "Each" after users finished editing No. of Packages (pic1)

formula: Each = QTY/Packages

how should i do?
Title: Re: How to calculate and fill in values in other cells when a cell finished editiong
Post by: paramvir on September 18, 2014, 01:33:35 pm
Please follow this example:

http://paramquery.com/pro/demos/render_cells
Title: Re: How to calculate and fill in values in other cells when a cell finished editiong
Post by: lsl on September 18, 2014, 01:45:44 pm
there are 2 problems using "render"
1. we need the result to be filled in "Each" field before the changes are committed to DB
2. we already have render functions which doing number formatting in that column.

Title: Re: How to calculate and fill in values in other cells when a cell finished editiong
Post by: paramvir on September 18, 2014, 02:07:05 pm
make changes in the rowData in cellSave event

ui.rowData["Each"] = calculated value;

and

call refreshCell( {dataIndx: 'Each', rowIndx : ui.rowIndx}) after that.