Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
149356 | Nov 22,2019 03:44 PM UTC | Nov 25,2019 01:07 PM UTC | Angular - EJ 2 | 1 |
![]() |
Tags: Grid |
App.component.ts
import { Component,ViewChild, OnInit } from '@angular/core';
import { data } from './datasource';
import { EditSettingsModel, GridComponent, ToolbarItems } from '@syncfusion/ej2-angular-grids';
@Component({
selector: 'app-container',
template: `<ejs-grid [dataSource]='data'#grid id='grid' [editSettings]='editSettings'[toolbar]='toolbar' (created)= Oncreated($event)' >
…
</ejs-grid>`
})
export class AppComponent implements OnInit {
…
ngOnInit(): void {
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Dialog'
}
this.toolbar = ['Add', 'Edit', 'Delete']
Oncreated(args){
this.groupsService.getGroups().subscribe(
data => {
this.dataSource = data;
(this.groupsGrid.dataSource as ResultGroup[]) = data;
this.groupsGrid.refresh();
}
}
}
|
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.