Hello,
data for treeview I am getting from backend and database. I am using property loadOnDemand:true. I am using this code to get data from backend:
ngAfterViewInit()
{
$("#treeView").ejTreeView({loadOnDemand: true});
var dataManager = new ej.DataManager({ url: this.myUrl + "menu/GetMenuPost", crossDomain: true, adaptor: new ej.UrlAdaptor(),
headers: [{Authorization: 'Bearer ' + JSON.parse(localStorage.getItem('currentUser')).authToken}] });
this.menuFields = { dataSource: dataManager, id: 'id', parentId: 'parent_Id', text: 'text', hasChild: 'leaf', expanded: 'expanded', imageUrl: 'iconCls', tableName: 'className' };
}
When I set property expanded to true in my backend, the first node after view init is not expanded. But when I expand it, all other nodes is expanded. What do I need to do to get my first node expand after view init?