Author Topic: LOSTFOCUS edit field and sum of two fields column values  (Read 3134 times)

rdorazio

  • Newbie
  • *
  • Posts: 9
    • View Profile
LOSTFOCUS edit field and sum of two fields column values
« on: May 25, 2016, 04:31:59 am »
I have a question , how do I trigger a LostFocus event in the particular field editing and calculating the sum of two fields of the column.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: LOSTFOCUS edit field and sum of two fields column values
« Reply #1 on: May 25, 2016, 04:53:07 pm »
The sum or any dependent cells can be calculated with column.formula callback.

http://paramquery.com/pro/demos/grid_formula

Rest of your question is not clear how it relates to computed column, could you please elaborate it bit more.

rdorazio

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: LOSTFOCUS edit field and sum of two fields column values
« Reply #2 on: May 25, 2016, 05:52:55 pm »

See the Total column has not been updated .
How do I update it when losing the focus of the Exports column

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: LOSTFOCUS edit field and sum of two fields column values
« Reply #3 on: May 25, 2016, 06:10:24 pm »
It can be corrected by refreshing row in cellSave event.

Code: [Select]
cellSave: function(evt, ui){
this.refreshRow(ui);
}

The demo is corrected now.
« Last Edit: May 25, 2016, 06:12:10 pm by paramquery »