Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
148348 | Oct 16,2019 07:17 AM UTC | Oct 18,2019 09:29 AM UTC | Angular - EJ 2 | 1 |
![]() |
Tags: Grid |
<ejs-grid #grid id='Grid' [dataSource]='hierarchygrid' (load)='onLoad($event)' [childGrid]='childGrid'>
<e-columns>
<e-column headerText='Button' width='150' textAlign='Center'>
<ng-template #template let-data>
<div class="button">
<button ejs-button (click)="onClick($event)" #button>Buttons</button>
</div>
</ng-template>
</e-column>
</e-columns>
</ejs-grid>
onClick(args) {
var tr = args.target.closest('tr');
var childId = tr.nextElementSibling.getElementsByTagName('div')[0].getAttribute('id');
var grid = (document.getElementById(childId) as any).ej2_instances[0];
if (tr.firstElementChild.getAttribute("aria-expanded") && grid) {
var data = { "id": 1, "Data": "Raja", "Adress": "shdgsjh", "contach": "973763633" };
grid.editModule.addRecord(data, 0);
}
} |
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.