view
의 버튼을 클릭하면 생성되는 view
을 렌더링하고 싶습니다.secha touch의 컨트롤러에서 뷰 호출 MVC 패턴
여기 내 컨트롤러 코드, 그리고 내가 검색 한 MVC architecture
Ext.define('demo.controller.LoginController' , {
extend: 'Ext.app.Controller',
config: {
refs:{
loginAction: 'button[action=login]'
},
control:{
loginAction: {
tap:'loginProcess'
}
}
},
loginProcess:function(button,e,opts){
// Render View here
}
});
에 따라, 그리고 난이 getMainView().push()
및 Ext.ViewPoart.add()
통해 온하지만 작동하지 않습니다. MVC 패턴에 따르면 컨트롤러에서이 뷰를 어떻게 호출해야합니까? 당신이 올바르게 설정 한 경우 당신이 작동해야 시도하는 방법 중 profilecontainer
Ext.define('demo.view.ProfileContainer',{
extend:'Ext.Panel',
xtype:'profilecontainer',
requires: [
'Ext.Label'
],
config: {
items:[{
xtype:'label',
html:'hi'
}]
}
});
필자는'Ext.Viewport.add ({xtype : 'profilecontainer'});''profilecontainer'는 내'View'이고'app.js'에 등록하고'xtype'는로 정의합니다. 'profilecontainer'하지만 여전히 기존의 뷰를 호출 할 수 없습니다. 로그인 버튼 이벤트가 실행되는 방식으로 확인했습니다. – Hunt
이 경우,'profilecontainer'에 대한 코드를 게시해야합니다. 콘솔에 오류가 표시됩니까? – kevhender
오류 없음, 내가 원하는 것은 목록이있는 새로운 뷰를 완전히로드하고,'profilecontainer'에 대한 나의 편집을 참조하십시오. – Hunt