@Component({
selector: 'ej-app', templateUrl: 'app/components/treegrid/treegrid.component.html',
styleUrls: ['app/components/treegrid/treegrid.component.css'], }) |
[treegrid.component.css]
ej-treegrid {
display: block;
} |
[html]
<ej-splitter #hcsplitter id="HCSplitter" height="400" width="100%" (create)="splitterCreate($event)" (resize)="splitterResize($event)">
//…
[TS]
splitterCreate = function (args) {
var treeObj = $("#TreeGridControl").ejTreeGrid("instance");
treeObj._windowResize();
}
splitterResize = function (args) {
var treeObj = $("#TreeGridControl").ejTreeGrid("instance");
treeObj._windowResize();
} |
Hi,
Please explain how to take TreeGrid Reference in ts file. Here you have used Jquery. Can't we use Angular way to get it done?
I need to trigger expandAtLevel() method of Angular2 TreeGrid. Please give a sample or code snippet to achieve that.
Thanks,
Aswath
import { Component, ViewEncapsulation, ViewChild } from '@angular/core';
import {CommonModule} from "@angular/common";
import { EJComponents} from 'ej-angular2';
export class AppComponent {
public constructor(){}
@ViewChild('TreeGridControl') treegrid : EJComponents<any, any>;
expandData(id: number) { var treeObj = this.treegrid.widget; treeObj.expandAtLevel(id); } |