Sencha Touch MVC 中 store 的使用
I have a UserStore that I want to load after succesful login of a user. I can't get this to work i.e. find a pattern to do this. I now have the UserStore in the app.js like this:
The store
The user is retrieved based on the php $_SESSION['userid'] which is not set before a user is loggedin. When starting up the app the store is loaded but it doesn't find any data. I need to go back to the beginning to log in again and then of course the session id was set in the previous login. What I am trying to accomplish is either to lazy load the store or to autoload only when needed by the View. I have tried this but I can't get it to work. This is what I did: option 1 I removed the UserStore from app.js and added a require and xtype item to the View but then I get [WARN][Ext.dataview.DataView#applyStore] The specified Store cannot be found The View
Option 2 try to find out if I can set the autoload to false and load in on demand via some listener. But I can't find out exactly how. So, how can this be achieved and what is the best pattern to do this. Thanks for your help! Ext.dataview.DataView#applyStore The specified Store cannot be found |
|||
I actually never assign stores this way:
|
|||
关注公众号,分享干货,讨论技术
Sencha Touch MVC 中 store 的使用的更多相关文章
- Sencha Touch 2.2 Store Proxy 异常监控
移动端到服务端通信往往会发生很多莫名的异常情况,如何有效的监控proxy异常,给用户友好的用户体验呢? Proxy给我提供了异常exception的监听事件,只需要监控该项目即可. Sencha To ...
- sencha touch dataview 中添加 button 等复杂布局并添加监听事件
config 中的属性默认都会自动生成 getter setter applier updater 四个方法. applier 在调用 setter 时被调用, updater 在属性值 ...
- Sencha Touch 2中如何动态添加button
原理很简单无非就是在一个容器上面选中id,用容器的add方法将button循环加入. 现在我们来试一下 1.先定义一个Container组件用,以后在里面添加button ? 1 2 xtype:'c ...
- sencha touch mvc
controller: Ext.define('MyApp2.controller.MyController1', { extend: 'Ext.app.Controller', config: { ...
- sencha touch 2中判断游览器是否包含webkit的方法
<script type="text/javascript"> if (!Ext.browser.is.WebKit) { alert("The curren ...
- 【翻译】Sencha Touch 2入门:创建一个实用的天气应用程序之三
原文:Getting Started with Sencha Touch 2: Build a Weather Utility App (Part 3) 作者:Lee BoonstraLee is a ...
- sencha touch 常见问题解答(26-50)
26.sencha touch在华为.红米等部分手机下hide事件失效,msgbox无法关闭怎么办 答:请看http://www.cnblogs.com/cjpx00008/p/3535557.htm ...
- 第四步 使用 adt-eclipse 打包 Cordova (3.0及其以上版本) + sencha touch 项目
cordova最新中文api http://cordova.apache.org/docs/zh/3.1.0/ 1.将Cordova 生成的项目导入到adt-eclipse中,如下: 项目结构如下: ...
- Sencha Touch 2 实现跨域访问
最近要做手机移动App,最后采用HTMML5来做框架用Sencha Touch,在数据交互时遇到了Ajax跨域访问,在Sencha Touch 2中,实现跨域访问可以使用Ext类库提供给我们的类Ext ...
随机推荐
- Hadoop:WordCount分析
相关代码: package com.hadoop; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.P ...
- Vue-router用法
#全局守卫- router.beforeEach(to,from,next){} #全局后置钩子- router.afterEach(to,from){} #路由独享守卫- beforeEnter(t ...
- Delphi实例之绘制正弦函数图像
Delphi实例之绘制正弦函数图像 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphic ...
- nginx启动和配置
1.命令行参数 -c </path/to/config> 为 Nginx 指定一个配置文件,来代替缺省的.路径应为绝对路径 -t 不运行,而仅仅测试配置文件.nginx 将检查配置文件的语 ...
- Python 并发编程:PoolExecutor 篇
个人笔记,如有疏漏,还请指正. 使用多线程(threading)和多进程(multiprocessing)完成常规的并发需求,在启动的时候 start.join 等步骤不能省,复杂的需要还要用 1-2 ...
- UVA 11882 Biggest Number(搜索+剪枝)
You have a maze with obstacles and non-zero digits in it: You can start from any square, walk in the ...
- cygwin上编译RPC框架thrift
cygwin的配置就不多说了,缺什么就通过安装器安装好了. 在thrift的官网下载 thrift-0.11.0源码,通过cmake编译,生成Makefile之后,make出现编译错误 /cygdri ...
- c语言实现带LRU机制的哈希表
#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h&g ...
- lintcode-104-合并k个排序链表
104-合并k个排序链表 合并k个排序链表,并且返回合并后的排序链表.尝试分析和描述其复杂度. 样例 给出3个排序链表[2->4->null,null,-1->null],返回 -1 ...
- 条件查询Criteria
public User getUserByNameCri(String name){ Session session = null; User user = null; try { session = ...