Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
149360 | Nov 22,2019 07:32 PM UTC | Nov 25,2019 10:10 AM UTC | Angular - EJ 2 | 1 |
![]() |
Tags: Grid |
@Component({
selector: 'app-root',
template: ` <ejs-grid #grid id='Normalgrid' (click)="click($event)" [dataSource]='data' allowPaging='true'
[pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar'>
<e-columns>
. . .
</e-columns>
</ejs-grid>`,
})
export class AppComponent {
. . .
click(e){
// for normal ediitng
if (e.target.classList.contains("e-rowcell")) {
if (this.grid.isEdit)
this.grid.endEdit();
let index: number = parseInt(e.target.getAttribute("Index"));
let rowData = this.grid.currentViewData[index] as any;
// Update the required cell value
rowData.Verified = !rowData.Verified;
// Update the row with the modified data
// this.grid.updateRow(index, rowData);
// if you want the row should move to edit state please use the below code instead of updating the row
// this.grid.selectRow(index);
//this.grid.startEdit();
}
}
}
|
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.