1
필자는 treelist를 사용하고 있으며 Afterrender 함수에서 내 탐색 목록을 동적으로 변경하려고합니다.Extjs 6.2 트리스트 변경 선택 동적으로
Ext.create({
xtype: 'treelist',
reference: 'navigationTreeList',
itemId: 'navigationTreeList',
ui: 'nav',
store: Ext.create('Ext.data.Store', {
fields: [{
name: 'text'
}],
root: {
expanded: true,
children: [{
text: 'Dashboard',
iconCls: 'x-fa fa-home',
rowCls: 'nav-tree-badge',
viewType: 'dashboardcei',
routeId: 'cei/dashboardcei',
leaf: true
},
{
text: 'Create Application',
iconCls: 'x-fa fa-send',
rowCls: 'nav-tree-badge',
routeId: 'cei/create-application',
viewType: 'create-application',
leaf: true
},
{
text: 'Application Status',
iconCls: 'x-fa fa-user',
routeId: 'cei/application-status',
viewType: 'application-status',
leaf: true
}
]
}
}),
width: 250,
expanderFirst: false,
expanderOnly: false,
listeners: {
afterrender: function(tree) {
var selection = tree.getStore().getData().items[1]; // bydefault "create application page should be open instead of dashboard"
tree.fireEvent('selectionchange', tree, selection);
}
}
});
위의 렌더링 기능에서 treelist에서 페이지로드시 기본적으로 "응용 프로그램 페이지 만들기"를 열어 보는 실험입니다. 그 열기는 페이지지만, 실제로 선택은 선택처럼 일어나지 않는다. 나는 지난 이틀간 문제가 해결 되었다면 아무도 도와 줄 수 없다.
감사합니다. @ Njdhv가 작동 중입니다. – RaviPatidar
대부분 환영합니다. @RaviPatidar –