这是我的应用结构。
var loginView = Ext.create( Ext.Panel ,{
id: LoginView ,
.....
});
var homeView = Ext.create( Ext.TabPanel ,{
id: HomeView ,
items: [
{
xtype: list ,
title: Home ,
store: Ext.create( TweetStore ),
disableSelection: true,
....
},
{
title: Reply ,
....
},
{
title: DM ,
....
}
]
});
var mainView = Ext.create( Ext.Panel ,{
id: MainView ,
layout: card ,
items: [ loginView, mainView ]
});
Ext.define( TweetStore , {
extend: Ext.data.Store ,
config: {
fields: ...
pageSize: 25,
autoLoad: true,
proxy: {
type: ajax ,
url: /home ,
pageParam: page ,
limitParam: count ,
reader: {
type: json
}
}
}
});
MainView
有两个面板。 LoginView
是用户输入用户名和密码的登录页。授权成功时,第二个面板 HomeView
会显示 。
我的问题:
- I want the data in
TweetStore
to be loaded after the authorization, that is, when theHomeView
shows, the data begins to load. But theshow
event is triggered even the panel is still hidden. What event should I catch. - When the application starts, I want to send a ajax request to check whether the user is login, if true, the
LoginView
hide and theHomeView
shows. In which event should I check this?