How to auto update the cell data when other cell editing

Here is the sample code: https://stackblitz.com/edit/react-pmknfe?file=index.js

I want to auto change the sum value when number 1 or number 2 editing

3 Replies

RR Rajapandi Ravi Syncfusion Team April 16, 2020 01:39 PM UTC

Hi , 

From checking your query, we understand you want to update the sum column value while changing the value of the other column. Based on your query we have prepared a sample and achieved your requirement by using change event of NumericTextBox. Please refer the below code example for more information.  

 
  const actionComplete = args => { 
    if (args.requestType === "beginEdit") { 
      var col1 = args.form[1].ej2_instances[0];       //Numerictextbox instance 
      var col2 = args.form[3].ej2_instances[0]; 
      var col3 = args.form[5].ej2_instances[0]; 

      col1.change = (e, args) => { 
        col3.element.value = +(col1.element.value) + +(col2.element.value);      //update the values to the sum column 
      } 
      col2.change = e => { 
        val2 = e.value; 
        col3.element.value = +(col1.element.value) + +(col2.element.value);       //update the values to the sum column 
      }  
    } 
     
  }; 
 
 


Regards,
Rajapandi R 



DE developer April 17, 2020 01:58 AM UTC

Thank you so much. The problem has been solved


RR Rajapandi Ravi Syncfusion Team April 17, 2020 12:20 PM UTC

Hi , 

We are happy to hear that your issue has been resolved. 

Please get back to us if you need further assistance 

Regards 
Rajapandi R 
 


Loader.
Up arrow icon