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 |
![]() |
Tags: Grid |
<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;
}
|
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.
This page will automatically be redirected to the sign-in page in 10 seconds.