Author Topic: How to calculate and fill in values in other cells when a cell finished editiong  (Read 3445 times)

lsl

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 67
    • View Profile
I want to fill in the column "Each" after users finished editing No. of Packages (pic1)

formula: Each = QTY/Packages

how should i do?
« Last Edit: September 18, 2014, 09:34:42 am by lsl »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile

lsl

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 67
    • View Profile
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.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
make changes in the rowData in cellSave event

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

and

call refreshCell( {dataIndx: 'Each', rowIndx : ui.rowIndx}) after that.
« Last Edit: September 18, 2014, 02:14:45 pm by paramquery »