- Sencha Touch 指南
- Sencha Touch - 主頁
- Sencha Touch - 概覽
- Sencha Touch - 環境
- Sencha Touch - 命名約定
- Sencha Touch - 架構
- Sencha Touch - MVC 說明
- Sencha Touch - 第一個應用
- Sencha Touch - 構建應用程式
- Sencha Touch - 遷移步驟
- Sencha Touch - 核心概念
- Sencha Touch - 資料
- Sencha Touch - 主題
- Sencha Touch - 裝置配置檔案
- Sencha Touch - 依賴項
- 環境檢測
- Sencha Touch - 事件
- Sencha Touch - 佈局
- Sencha Touch - 歷史記錄和支援
- Sencha Touch - 上傳和下載
- Sencha Touch - 檢視元件
- Sencha Touch - 封裝
- Sencha Touch - 最佳實踐
- Sencha Touch 有用資源
- Sencha Touch - 快速指南
- Sencha Touch - 有用資源
- Sencha Touch - 討論
Sencha Touch - 代理
代理的基類是 Ext.data.proxy.Proxy。模型和儲存會使用代理來處理模型資料的載入和儲存。
有兩種型別的代理 −
- 客戶端代理
- 伺服器代理
客戶端代理
客戶端代理包括記憶體和本地儲存,它們會使用 HTML5 本地儲存。
伺服器代理
伺服器代理會使用 Ajax、Json 資料以及 Rest 服務來處理來自遠端伺服器的資料。代理可以寫入模型並在任意位置儲存。
Ext.create('Ext.data.Store', {
model: 'StudentDataModel', proxy : {
type : 'rest', actionMethods : {
read : 'POST'
// Get or Post type based on requirement
},
url : 'restUrlPathOrJsonFilePath',
// here we have to include the rest URL path
which fetches data from database or Json file path where the data is stored reader: {
type : 'json',
// the type of data which is fetched is of JSON type
root : 'data'
},
}
});
sencha_touch_data.htm
廣告