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

Update Multiple Rows on cellClose event

1 Answer 134 Views
Grid
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, 03:16 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){<br>    var dataItem=e.sender.dataItem($(e.container).parent())// getting the current edited row<br>    var aux= e.sender.dataSource.data(); //getting all rows<br>    var dataTotal= aux[aux.length-1]; //geting total row<br>    <br>    valueB=dataItem["Column_B"];<br>    valueC=dataItem["Column_C"];<br>    dataItem.set("Column_D",valueB*ValueC);<br>    <br>      var sum=0;<br>       for (let i=0;i<aux.length-1;i++)//getting sum of values of Column_D<br>       {<br>               sum=sum+aux[i].Column_D;<br>       } <br>      dataTotal.set("Column_D",sum) // setting sum<br>    <br>    <br>    } <br>

 

1 Answer, 1 is accepted

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

Hi Derian,

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

Regards,
Petar
Progress Telerik

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