Extjs 从App.JS调用商店
我在app.js文件中。当用户成功登录到stytem时,会执行一个函数Extjs 从App.JS调用商店,extjs,extjs4,extjs-mvc,extjs4.1,Extjs,Extjs4,Extjs Mvc,Extjs4.1,我在app.js文件中。当用户成功登录到stytem时,会执行一个函数 loginSuccess: function() { this.getViewport().getLayout().setActiveItem(1).store.load(); // Calls the Store of the i need to navigate this.getViewport().getLayout().setActiveItem(1); // The view i will
loginSuccess: function() {
this.getViewport().getLayout().setActiveItem(1).store.load(); // Calls the Store of the i need to navigate
this.getViewport().getLayout().setActiveItem(1); // The view i will be navigating
}
我收到一个错误,说明此.getViewport().getLayout().setActiveItem(1).存储未定义。我想我打错电话了。我怎样才能纠正这个问题?如何从app.js调用商店
更新
var st = Ext.getStore('myStore');
st.load();
st.on('load', function() {
this.getViewport().getLayout().setActiveItem(1);
});
启动存储加载的正确方法是:
var st = Ext.getStore('MyStore');
st.load();
请记住,加载是一个异步过程,因此,如果希望在加载存储后执行某些操作,则不能在
load()
之后编写代码-您需要订阅load
事件 你想激活的项目是什么?订阅load
方法是什么意思?st.on('load',function(){got\u something\u her})
你的意思是写这个.getViewport().getLayout().setActiveItem(1)代码>在st.on('load',function()…
)中?这是在登录成功时显示第二个视图。在显示第二个视图之前,我正在从存储中加载记录,然后显示将显示这些记录的视图。然后是,在该事件处理程序函数中,您是否设置为活动