We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Refreshing a single cell in Inline editing grid

Thread ID:

Created:

Updated:

Platform:

Replies:

144939 May 29,2019 12:36 PM UTC May 30,2019 10:08 AM UTC Angular - EJ 2 1
loading
Tags: Grid
Jatin Chawla
Asked On May 29, 2019 12:36 PM UTC

Hi Team

Is there any way that I can change a cell value in Inline editing of grid and it updates other cell without refreshing it?

Pavithra Subramaniyam [Syncfusion]
Replied On May 30, 2019 10:08 AM UTC

Hi Jatin,  
 
Thanks for contacting Syncfusion support  
 
Query1: Is there any way that I can change a cell value in Inline editing of grid and it updates other cell without refreshing it? 
 
From your query we understand that you need to update the value of one column while changing the another column in inline editing. We suggest you achieve your requirement using ValueAccessor property of ejs grid. Using ValueAccessor column we can display the values based on other columns. So while editing also once the records are saved, value will be updated based on changed value. 
 
Refer the below code example 
 
   <button ejs-button (click)='handleClick($event)'>Clear Data</button> 
    <ejs-grid [dataSource]='data' (cellSave)="onsave($event)" [editSettings]='editSettings' [toolbar]='toolbar' [height]='150'> 
                <e-columns> 
                    <e-column field='OrderID' headerText='ID' isPrimaryKey='true' width=150></e-column> 
                    <e-column field='FoodName' headerText='Food Name' width=150></e-column> 
                    <e-column field='Protein' headerText='Protein' textAlign='Right' width=120></e-column> 
                    <e-column field='Fat' headerText='Fat' textAlign='Right' width=80></e-column> 
                    <e-column field='Carbohydrate' headerText='Carbohydrate' textAlign='Right' width=120></e-column> 
                    <e-column headerText='Calories Intake' textAlign='Right' [valueAccessor]='totalCalories' width=150></e-column> 
                </e-columns> 
            </ejs-grid> 
……………………………………. 
 
  public totalCalories = (field: string, data: { Protein: number, Fat: number, Carbohydrate: number }, column: Object): number => { 
        return data.Protein * 4 + data.Fat * 9 + data.Carbohydrate * 4; 
    } 
 
 
Note: while editing, value of the CaloriesIntake column will updated based on modified values.  
 
For your convenience we have prepared a sample which can be referred below  
 
 
Refer our UG documentation for your reference 
 
 
Regards, 
Pavithra S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon