0
'카드'레이아웃이있는 MainView에는 MenuView와 TestView의 두 항목이 있습니다. MenuView에 대해 setActive를 설정할 때, 너비는 1280 인 MainView의 너비와 같습니다. menuView에서 버튼을 누른 다음 다음 액션에서 TestView를 setActive하지만 너비는 0입니다. 아무도 나를 설명 할 수 있습니까? 그리고 나에게 여기에 1280 에 그리고 TestView의 폭을 설정하는 방법을 엽차 터치 1 내 코드입니다 제공 :왜 setActiveItem 후에 너비가 변경됩니까?
'Ext.regController('MainController',{
'index': function(options){
if (!Test.views.mainView){
Test.views.mainView = new Test.views.MainView();
}
console.log('mainView width: '+ Test.views.mainView.getWidth());
console.log('menuView width: '+ Test.views.menuView.getWidth());
Test.views.mainView.setActiveItem(Test.views.menuView);
},
'start': function(options){
console.log('testView width: '+ Test.views.testView.getWidth());
Test.views.mainView.setActiveItem(Test.views.testView);
}
});
Test.views.MainView = Ext.extend(Ext.Panel, {
fullscreen : 'true',
layout : 'card',
cardSwitchAnimation : 'slide',
initComponent : function(){
Ext.apply(Test.views, {
menuView: new Test.views.MenuView(),
testView: new Test.views.TestView()
});
this.items = [Test.views.menuView, Test.views.testView]
Test.views.MainView.superclass.initComponent.call(this);
}
});
Test.views.MenuView = Ext.extend(Ext.Panel,{
initComponent: function(){
this.startButton = new Ext.Button({
text: 'Start',
ui: 'action',
scope: this,
handler: function(){
Ext.dispatch({
controller: Test.controllers.mainController,
action: 'start'
});
}
});
this.exitButton = new Ext.Button({
text: 'Exit',
ui: 'action',
scope: this,
handler: function(){
}
});
this.items = [this.startButton, this.exitButton]
Test.views.MenuView.superclass.initComponent.call(this);
}
});
Test.views.TestView = Ext.extend(Ext.Panel,{
initComponent: function(){
this.html = 'test';
Test.views.TestView.superclass.initComponent.call(this);
}
});
감사합니다.하지만 내 TestView의 너비가 0으로 변경되는 이유를 설명 할 수 있습니까? 먼저 활성화 된보기는 항상 너비가 초기화되지만 두 번째 너비는 0입니다. –