This is a migrated thread and some comments may be shown as answers.

Update Multiple Rows on cellClose event

1 Answer 29 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Derian
Top achievements
Rank 1
Veteran
Derian asked on 18 Aug 2020, 12:58 AM

I'm using the cellClose event to update cell values, it works within the values in the selected row. I have a last row called Total which is the sum of the Values of the Column D
----------Column_A Column_B Column_C Column_D
----------Product1---ValueB1---ValueC1-------ValueD1
----------Product2---ValueB2---ValueC2-------ValueD2
----------Total------------------------------------------ValueT
Column D= Column_C * Column_B and ValueT = ValueD1 + ValueD2
When i update ValueC1 or ValueB1 , ValueD1 gets updated and re-rendered with the new value . The problem is that the ValueT gets udpated but it doesnt re-render .
The code i have is this one :

 

cellClose:function(e){
var dataItem=e.sender.dataItem($(e.container).parent())// getting the current edited row
var aux= e.sender.dataSource.data(); //getting all rows
var dataTotal= aux[aux.length-1]; //geting total row
 
valueB=dataItem["Column_B"];
valueC=dataItem["Column_C"];
dataItem.set("Column_D",valueB*ValueC);
 
  var sum=0;
   for (let i=0;i<aux.length-1;i++)//getting sum of values of Column_D
   {
           sum=sum+aux[i].Column_D;
   }
  dataTotal.set("Column_D",sum) // setting sum
 
 
}

1 Answer, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 19 Aug 2020, 12:53 PM

Hi Derian,

This post is a duplicate of a support thread that you've submitted. To keep the communication consistent, I would like to ask you to continue the discussion in the support ticket in which I've already answered you(1480962). 

Regards,
Petar
Progress Telerik

Tags
General Discussions
Asked by
Derian
Top achievements
Rank 1
Veteran
Answers by
Petar
Telerik team
Share this question
or