文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > Using Proxy in senchaTouch2
侵权投诉

Using Proxy in senchaTouch2

非常好的sencha touch入门资料

Using Proxies

翻译者:郭玉潮

(为了方便书写,本文中约定sencha touch 2简写为ST2。)

要是想了解Proxy,其实解释并不是很难,简单的说就是代理,那么代理又是什么呢,我们先来好好的研究一下ST2中的MVC吧,我们这里并不想详细讲解MVC,在ST2中,我们的数据模型定义在Model中,那么这些数据的实体呢,就在Store中,Store就是利用Proxy来操作数据的加载和保存的(MVC请见ST2中的详细讲解)。

在ST2中,Proxy只要有两大类:client和server。好,那么我们就先看看client类的Proxy:

Ext.data.proxy.LocalStorageproxy: localstorage

该代理,使用了HTML5最新的特性,使用了localStorage API将Model的数据直接存储在客户端的浏览器中。这些数据只能是简单的键值对的,不能存储复杂的数据的,像JSON就不行的。在我们保存或者检索数据的时候,LocalStorageProxy将自动的组串或者解串。

localStorage在保存用户的一些特殊信息方面还是极其有用的,因为这并不需要服务器来添加其他的设置来支持这些的。假如我们正在写一个Twitter搜索的应用程序,并把这些搜索的信息存储在本地,以便稍后检索。我们就可以创建一个Search的model:

Using Proxy in senchaTouch2

第1页

你可能喜欢

热门文档

相关文档

  • Using Components in senchaTouch2

    Using Components in senchaTouch2_IT/计算机_专业资料。选填,简要介绍文档的... Using Proxy in senchaT... 15页 免费 Using Froms in senchaT... 暂无...

  • Using Froms in senchaTouch2

    Using Froms in senchaTouch2_IT/计算机_专业资料。选填,简要介绍文档的主要... Using Proxy in senchaT... 15页 免费 using L-moments in 暂无评价 14页...

  • ...WebLogic 9.2 with OAM 10.1.4.3(using Proxy)

    Integration WebLogic 9.2 with OAM 10.1.4.3(using Proxy)_IT/计算机_专业资料。Oracle Access Manager与WebLogic集成,使用Proxy...

  • 代理(Proxy)模式

    五、 代理模式示例性代码以下示例性代码实现了代理模式: // Proxy pattern -- Structural example using System; // "Subject" abstract class Subject { // ...

  • Sencha Touch 2 使用数据模型

    比如要列出给定用户每个帖子中的全部评论,我们可以这样做: // Loads User with ID 1 and related posts and comments using User's Proxy // 使用 User 的...

  • Proxy+Server负载均衡处理+Tunneling+with+HTTP+CONNECT

    All subsequent communications between the client and the remote secure server are encrypted using that key and sent to the proxy server which then acts ...

  • 动态代理之AOP实现

    { interceptor});//实例化 return proxy as T; } } } 最后我们测试一下 代码 using using using using System; System.Collections.Generic; System.Linq; ...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email