2
어떻게 ExtJs 4 툴바에 항목을 동적으로로드 할 수 있습니까? JSON에서 항목을로드하려고합니다.ExtJs4가 툴바에 항목을 동적으로로드합니다.
로더를 사용해 보았지만 두통이되었습니다.
Ext.define('Backend.view.Nav' ,{
alias: 'widget.Nav',
extend: 'Ext.toolbar.Toolbar',
initComponent: function() {
this.items = [
{
iconCls: 'freewinder',
text: 'Freewinder'
},
{
iconCls: 'application',
text: 'Applikationen',
xtype: 'splitbutton'
},
{
iconCls: 'component',
text: 'Komponenten',
xtype: 'splitbutton'
},
'-',
{
emptyText: 'Suche ...',
xtype: 'textfield'
}];
this.callParent(arguments);
}
});
서버 출력 json을 원합니다. this.items = jsonItems는 훌륭하지만 나는 이해하지 못합니다. 내 코드를 hieres ... Ext.define ('Backend.view.Nav', { \t 별칭 : 'widget.Nav', 확장 'Ext.toolbar.Toolbar를' initComponent 함수 : 함수() { \t VAR = 날이, \t VAR 가기 Ext.create = ('Backend.store.Nav'); \t \t store.load (함수() { \t \t \t me.items = 저장소; \t \t}); ... – Peter
me.items = store doesnt work,하지만 왜? – Peter
도구 모음을 작성한 후 XMLHttpRequest (AJAX 요청)가 완료되기 때문에 hav initComponent가 실행되기 전에로드 된 항목. – Tower