CRUD in extjs 3.0
上传者:孙公权|上传时间:2015-05-07|密次下载
CRUD in extjs 3.0
CRUD in extjs 3.0
A quick look at the new ext.data.
Writer in 3.0
Agenda?? ?
Today I will be sharing notes from my early experiments with
the ext.data.Writer from extjs 3.0.?
The code I did while looking at it this is available at :
http://wendang.chazidian.com/jacobandresen/yase/tree/master?
?
?(find a version done around 2009-06-17 )
Manipulating relational data?? ?
What we usually want to do with data
?Create ? ? ? ? ? ? ? ? ? ? ? ? ? ? INSERT
?Read / Retrieve??????????????? SELECT
?Update??????????????????????????? UPDATE
?Delete /Destroy?????????????? DELETE
?
So far we have only been able to READ data out of the box.
the other operations needed work.
Now extjs 3.0 introduces the ext.data.writer. It can do the
rest.
Introducing the writer?? ?
We declare the writer like this
var settingsWriter = new Ext.data.JsonWriter({
? returnJson: true,
? writeAllFields: true
});
where writeAllFields identifies that we want to write all the
fields from the record to the database. If you have a fancy
ORM then maybe you can set this to false.
using a Lightweight MVC/REST
architecture
We can now define a "settings resource" in the following
manner on the proxy:
var settingsProxy = new Ext.data.HttpProxy({
? api: {
??? read??? : 'app.php/settings/view',
??? create? : 'app.php/settings/create',
??? update? : 'app.php/settings/update',
??? destroy : 'app.php/settings/destroy'
? }
});
Note that view here is the same as "Read/Retrieve"!
Hooking up the datastore
The Writer and the proxy can be hooked to the store like this?
?
var settingsStore = new Ext.data.Store({
? id: 'setting',
? proxy: settingsProxy,
? reader: settingsReader,
? writer: settingsWriter,
?...
});
?
relaying information from components
When submitting data using the Ext.writer from components it
can be usefull to have centralized validations running in a
central place. Let's say that we have a SettingsGrid - we can
relay the save and update events like this :
?
..
?initComponent : function() {
??? this.viewConfig = {
????? forceFit: true
??? };
??? this.relayEvents(this.store, ['destroy', 'save', 'update']);
??? this.tbar = this.buildTopToolBar();
??? SettingsGrid.superclass.initComponent.call(this);
? },
?
looking at the restful examples
The extjs 3.0 distro supplies the following examples (and
more!):
examples/restful
examples/writer
These examples outline a MVC framework that can map
actions and path information to simple REST resources.
Steven Hiller has provided an example with Ruby on Rails? :
?
http://wendang.chazidian.com/2009/06/restful-store-
example-with-rails_04.html
Looking at the php MVC framework?? ?
The framwork consists of the following classes:
Model???????? (contains a simulated ORM in the examples)
Request ? ?? (parses the HTTP request to parameters)
Controller?? (dispatches the action known for the path)??????
Response??? (renders a suitable view (JSON) )
?
The framework is operated from a single point of entry that
uses dynamic class loading to? dispatch actions through the
controller identified in the url from HTTP request.
Following updated data from the grid
to the server
When the user alters a value in the grid, then a "save" event
occurs (if autosave is true).?
Upon the "save" event the grid determines which cells has
been altered. When we have an altered cell , then the
corresponding record is sent to the server with the 'root' from
the re
ader around it. E.g if we read with root "data", then we
send back with root "data".
We can have several records being sent at once. when
updating to the server (e.g multiple edits).
?
???? Questions ?
?
? jacob.andresen@http://wendang.chazidian.com
下载文档
热门试卷
- 2016年四川省内江市中考化学试卷
- 广西钦州市高新区2017届高三11月月考政治试卷
- 浙江省湖州市2016-2017学年高一上学期期中考试政治试卷
- 浙江省湖州市2016-2017学年高二上学期期中考试政治试卷
- 辽宁省铁岭市协作体2017届高三上学期第三次联考政治试卷
- 广西钦州市钦州港区2016-2017学年高二11月月考政治试卷
- 广西钦州市钦州港区2017届高三11月月考政治试卷
- 广西钦州市钦州港区2016-2017学年高一11月月考政治试卷
- 广西钦州市高新区2016-2017学年高二11月月考政治试卷
- 广西钦州市高新区2016-2017学年高一11月月考政治试卷
- 山东省滨州市三校2017届第一学期阶段测试初三英语试题
- 四川省成都七中2017届高三一诊模拟考试文科综合试卷
- 2017届普通高等学校招生全国统一考试模拟试题(附答案)
- 重庆市永川中学高2017级上期12月月考语文试题
- 江西宜春三中2017届高三第一学期第二次月考文科综合试题
- 内蒙古赤峰二中2017届高三上学期第三次月考英语试题
- 2017年六年级(上)数学期末考试卷
- 2017人教版小学英语三年级上期末笔试题
- 江苏省常州西藏民族中学2016-2017学年九年级思想品德第一学期第二次阶段测试试卷
- 重庆市九龙坡区七校2016-2017学年上期八年级素质测查(二)语文学科试题卷
- 江苏省无锡市钱桥中学2016年12月八年级语文阶段性测试卷
- 江苏省无锡市钱桥中学2016-2017学年七年级英语12月阶段检测试卷
- 山东省邹城市第八中学2016-2017学年八年级12月物理第4章试题(无答案)
- 【人教版】河北省2015-2016学年度九年级上期末语文试题卷(附答案)
- 四川省简阳市阳安中学2016年12月高二月考英语试卷
- 四川省成都龙泉中学高三上学期2016年12月月考试题文科综合能力测试
- 安徽省滁州中学2016—2017学年度第一学期12月月考高三英语试卷
- 山东省武城县第二中学2016.12高一年级上学期第二次月考历史试题(必修一第四、五单元)
- 福建省四地六校联考2016-2017学年上学期第三次月考高三化学试卷
- 甘肃省武威第二十三中学2016—2017学年度八年级第一学期12月月考生物试卷
网友关注
- 2018河北省考行测题库:行测每日一练资料分析练习题11.30
- 2018河北省考行测题库:行测每日一练判断推理练习题12.06
- 2018河北省考行测题库:行测每日一练言语理解练习题12.01
- 2018河北公务员考试面试热点模拟题:劝阻吸烟引发老人离世
- 2018河北省考行测题库:行测每日一练数量关系练习题答案11.17
- 2018河北省考行测题库:行测每日一练判断推理练习题答案11.21
- 2018河北省考行测题库:行测每日一练判断推理练习题答案12.06
- 2018河北省考行测题库:行测每日一练判断推理练习题答案12.07
- 2018河北省考行测题库:行测每日一练判断推理练习题11.23
- 2018河北公务员考试公安基础知识:公安执法监督的概念
- 2018河北省考行测题库:行测每日一练数量关系练习题11.17
- 2018河北省考行测题库:行测每日一练判断推理练习题答案11.23
- 2018河北省考行测题库:行测每日一练数量关系练习题答案11.24
- 2018河北公务员考试公安基础知识:社会治安综合治理的六大任务
- 2018河北省考行测题库:行测每日一练数量关系练习题11.28
- 【申论题库】2018河北省考申论每周一练答案:筑牢保护未成年人的网络堤坝
- 2018河北省考行测题库:行测每日一练言语理解练习题答案11.22
- 2018河北公务员面试模拟题:对刷单代写等这些“灰色兼职”说不
- 2018河北省考行测题库:行测每日一练言语理解练习题11.20
- 2018河北省考行测题库:行测每日一练数量关系练习题答案11.28
- 2018河北公务员面试模拟题:快递实名制如何考量利与弊
- 2018河北省考行测题库:行测每日一练判断推理练习题答案12.04
- 2018河北公务员考试公安基础知识:未成年犯的管理教育
- 2018河北省考行测题库:行测每日一练言语理解练习题12.05
- 2018河北省考行测题库:行测每日一练言语理解练习题答案11.20
- 2018河北省考行测题库:行测每日一练数量关系练习题11.24
- 2018河北省考行测题库:行测每日一练言语理解练习题答案12.01
- 2018河北公务员面试模拟题:把道德修养当做人生必修课
- 2018国家公务员考试河北考区申论冲刺模拟试卷(一)参考答案
- 2018河北省考行测题库:行测每日一练判断推理练习题答案11.27
网友关注视频
- 3.2 数学二年级下册第二单元 表内除法(一)整理和复习 李菲菲
- 30.3 由不共线三点的坐标确定二次函数_第一课时(市一等奖)(冀教版九年级下册)_T144342
- 第8课 对称剪纸_第一课时(二等奖)(沪书画版二年级上册)_T3784187
- 七年级英语下册 上海牛津版 Unit5
- 【部编】人教版语文七年级下册《逢入京使》优质课教学视频+PPT课件+教案,安徽省
- 【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,天津市
- 【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,辽宁省
- 北师大版小学数学四年级下册第15课小数乘小数一
- 冀教版小学英语五年级下册lesson2教学视频(2)
- 冀教版英语四年级下册第二课
- 【获奖】科粤版初三九年级化学下册第七章7.3浓稀的表示
- 沪教版牛津小学英语(深圳用) 四年级下册 Unit 3
- 第12章 圆锥曲线_12.7 抛物线的标准方程_第一课时(特等奖)(沪教版高二下册)_T274713
- 冀教版小学英语四年级下册Lesson2授课视频
- 19 爱护鸟类_第一课时(二等奖)(桂美版二年级下册)_T3763925
- 冀教版小学数学二年级下册第二单元《有余数除法的竖式计算》
- 苏科版数学八年级下册9.2《中心对称和中心对称图形》
- 冀教版小学数学二年级下册1
- 【部编】人教版语文七年级下册《过松源晨炊漆公店(其五)》优质课教学视频+PPT课件+教案,江苏省
- 【部编】人教版语文七年级下册《泊秦淮》优质课教学视频+PPT课件+教案,广东省
- 沪教版牛津小学英语(深圳用) 四年级下册 Unit 4
- 8.练习八_第一课时(特等奖)(苏教版三年级上册)_T142692
- 外研版英语七年级下册module1unit3名词性物主代词讲解
- 【部编】人教版语文七年级下册《逢入京使》优质课教学视频+PPT课件+教案,安徽省
- 《小学数学二年级下册》第二单元测试题讲解
- 8.对剪花样_第一课时(二等奖)(冀美版二年级上册)_T515402
- 六年级英语下册上海牛津版教材讲解 U1单词
- 北师大版数学四年级下册第三单元第四节街心广场
- 外研版英语七年级下册module3 unit1第二课时
- 人教版历史八年级下册第一课《中华人民共和国成立》
精品推荐
- 2016-2017学年高一语文人教版必修一+模块学业水平检测试题(含答案)
- 广西钦州市高新区2017届高三11月月考政治试卷
- 浙江省湖州市2016-2017学年高一上学期期中考试政治试卷
- 浙江省湖州市2016-2017学年高二上学期期中考试政治试卷
- 辽宁省铁岭市协作体2017届高三上学期第三次联考政治试卷
- 广西钦州市钦州港区2016-2017学年高二11月月考政治试卷
- 广西钦州市钦州港区2017届高三11月月考政治试卷
- 广西钦州市钦州港区2016-2017学年高一11月月考政治试卷
- 广西钦州市高新区2016-2017学年高二11月月考政治试卷
- 广西钦州市高新区2016-2017学年高一11月月考政治试卷
分类导航
- 互联网
- 电脑基础知识
- 计算机软件及应用
- 计算机硬件及网络
- 计算机应用/办公自动化
- .NET
- 数据结构与算法
- Java
- SEO
- C/C++资料
- linux/Unix相关
- 手机开发
- UML理论/建模
- 并行计算/云计算
- 嵌入式开发
- windows相关
- 软件工程
- 管理信息系统
- 开发文档
- 图形图像
- 网络与通信
- 网络信息安全
- 电子支付
- Labview
- matlab
- 网络资源
- Python
- Delphi/Perl
- 评测
- Flash/Flex
- CSS/Script
- 计算机原理
- PHP资料
- 数据挖掘与模式识别
- Web服务
- 数据库
- Visual Basic
- 电子商务
- 服务器
- 搜索引擎优化
- 存储
- 架构
- 行业软件
- 人工智能
- 计算机辅助设计
- 多媒体
- 软件测试
- 计算机硬件与维护
- 网站策划/UE
- 网页设计/UI
- 网吧管理