- 浏览: 215496 次
- 性别:
- 来自: 北京
-
文章分类
最新评论
-
zlbdexiaohao:
怎么去掉默认的图标,folderClosedIcon=&quo ...
FLEX 构建完美的带有CheckBox三状态的Tree控件 -
zlbdexiaohao:
看不懂看不懂
FLEX 构建完美的带有CheckBox三状态的Tree控件 -
FYIHDG:
[list][*][list][*][*][list][*][ ...
ImageIO读jpg的时候出现exception:bandOffsets.length is wr -
被剥削的程序员:
你好我在引用你的comboxtree解决问题的时候,发现点击父 ...
ComboBoxTree -
527184687:
[flash=200,200][url][img][list] ...
ext treePanel 更换图标 总结
经测试 可以用,并且做了修改可以兼容以前的代码格式
Ext.namespace("Ext.ux.data"); /** * @class Ext.ux.data.DwrProxy * @extends Ext.data.DataProxy * @author loeppky * An implementation of Ext.data.DataProxy that uses DWR to make a remote call. * Not all of Ext.data.DataProxy's configuration options make sense for Ext.ux.data.DwrProxy. * The following constructor sample code contains all the available options that can be set: * <code><pre> * new Ext.ux.data.DwrProxy({ * // Defined by Ext.data.DataProxy * api : { * read : DwrInterface.interfaceMethodName * }, * // Defined by Ext.Observable * listeners: { * 'beforeload': function(dataProxy, params) { * // DwrProxy knows to pull parameters for the Dwr call from params[dataProxy.loadArgsKey]. * params[dataProxy.loadArgsKey] = [ * // arg1 for DwrInterface.interfaceMethodName * // arg2 for DwrInterface.interfaceMethodName * // etc... * ]; * } * }, * // Defined by Ext.ux.data.DwrProxy * loadArgsKey : 'newLoadArgsKey' // This configuration option should almost never need to be set * }); * </pre></code> * Note that currently only the "read" operation is supported. Support for the rest of the CRUD options will be added soon. * @constructor * @param {Object} config A configuration object where the following can be set: * - api: as defined in {@link Ext.data.HttpProxy#api}. This is where the DWR function for a given CRUD operation is specified. * Note: only "read" is currently supported. * - listeners: as defined in {@link Ext.Observable#listeners} * - loadArgsKey: as defined in {@link Ext.ux.data.DwrProxy#loadArgsKey} */ Ext.ux.data.DWRProxy = function(config) { // Set loadArgsKey if its defined. // We do this manually since Ext.data.DataProxy doesn't call Ext.apply with the config object. if (config && config.loadArgsKey) { this.loadArgsKey = config.loadArgsKey; } //兼容以前2.x的使用格式 if(config && config.dwrFunction){ config.api={read:config.dwrFunction}; } Ext.ux.data.DWRProxy.superclass.constructor.call(this, config); }; Ext.extend(Ext.ux.data.DWRProxy, Ext.data.DataProxy, { /** * @cfg {String} loadArgsKey Defines where in the params object passed to the load method * that this class should look for arguments to pass to the "dwrFunction". * The order of arguments passed to a DWR function matters. * Must be set before calling load. * See the explanation of the "params" parameter for the load function for further explanation. */ loadArgsKey: 'dwrFunctionArgs', /** * DwrProxy implementation of DataProxy#doRequest. * This implementation attempts to mirror HttpProxy#doRequest as much as possible. * Requests are done using configured "DWR function" for the provided "action". * In the "read" case, the response data object is read into a block of Ext.data.Records using the passed {@link Ext.data.DataReader}, * and the records are then passed using to the provided callback. * @param {String} action The crud action type (create, read, update, destroy). Note: only "read" is currently supported. * @param {Ext.data.Record/Ext.data.Record[]} records If action is "read", records will be null. * @param {Object} params An object containing properties which are to be used as parameters for the request to the remote server. * Params is an Object, but the "DWR function" needs to be called with arguments in order. * To ensure that one's arguments are passed to their DWR function correctly, a user must either: * 1. call or know that the execute method was called explictly where the "params" argument's properties were added in the order expected by DWR OR * 2. listen to the "beforeload" and/or "beforewrite" events and add a property to params defined by "loadArgsKey" that is an array of the arguments to pass on to DWR. * If there is no property as defined by "loadArgsKey" within "params", then the whole "params" object will be used as the "loadArgs". * If there is a property as defined by "loadArgsKey" within "params", then this property will be used as the "loagArgs". * The "loadArgs" are iterated over to build up the list of arguments to pass to the "DWR function". * @param {Ext.data.DataReader} reader The Reader object which converts the data object into a block of Ext.data.Records. * @param {Function} callback A function to be called after the request. * The callback is passed the following arguments:<ul> * <li>records: Ext.data.Record[] The block of Ext.data.Records handled by the request.</li> * <li>params: The params object passed to this doRequest method</li> * <li>success: Boolean success indicator</li> * </ul> * @param {Object} scope The scope in which to call the callback. * @param {Object} options An optional argument which is passed to the callback as its second parameter. * @private */ doRequest : function(action, records, params, reader, callback, callbackScope, options) { var dataProxy = this; var loadArgs = params[this.loadArgsKey] || params; // the Array or Object to build up the "dwrFunctionArgs" var dwrFunctionArgs = []; // the arguments that will be passed to the dwrFunction if (loadArgs instanceof Array) { // Note: can't do a foreach loop over arrays because Ext added the "remove" method to Array's prototype. // This "remove" method gets added as an argument unless we explictly use numeric indexes. for (var i = 0; i < loadArgs.length; i++) { dwrFunctionArgs.push(loadArgs[i]); } } else { // loadArgs should be an Object for (var loadArgName in loadArgs) { dwrFunctionArgs.push(loadArgs[loadArgName]); } } dwrFunctionArgs.push(this.createCallback(action, params, reader, callback, callbackScope, options)); this.api.read.apply(Object, dwrFunctionArgs); // the scope for calling the dwrFunction doesn't matter, so we simply set it to Object. }, /** * Helper method for doRequest which returns a callback function for a DWR request. * The returned callback function in turn invokes the provided callback function. * This mirrors HttpProxy#createCallsback. * DWR is unique though in that it allows one to define a callback function for success and callback function for an exception. * This exceptionHandler callback parallels Ext's "remote exception" case. * This method thus returns two callback functions groupded as a single object that can be appended to the DWR function arguments as required by DWR. * @param {String} action See doRequest#action. * @param {Ext.data.Record/Ext.data.Record[]} records See doRequest#records. * @param {Object} params See doRequest#params. * @param {Ext.data.DataReader} reader See doRequest#reader. * @param {Function} callback See doRequest#callback. * @param {Object} scope See doRequest#scope. * @param {Object} options See doRequest#options. * @private */ createCallback : function(action, params, reader, callback, callbackScope, options) { return { callback: function(response){ if (action === Ext.data.Api.actions.read) { this.onRead(action, params, reader, callback, callbackScope, options, response); } else { this.onWrite(); } }.createDelegate(this), exceptionHandler : function(message, exception) { if (action === Ext.data.Api.actions.read) { // @deprecated: Fire loadexception for backwards compatibility. // The event is supposed to pass the response, but since DWR doesn't provide that to us, we pass the message. this.fireEvent("loadexception", this, params, message, exception); } // The event is supposed to pass the response, but since DWR doesn't provide that to us, we pass the message. this.fireEvent("exception", this, 'remote', action, params, message, exception); callback.call(callbackScope, null, options, false); }.createDelegate(this) }; }, /** * Helper method for createCallback for handling the read action. * After creating records from the provided response, it calls the provided callback function. * This mirrors HttpProxy#onRead. * @param {String} action See doRequest#action. * @param {Ext.data.Record/Ext.data.Record[]} records See doRequest#records. * @param {Object} params See doRequest#params. * @param {Ext.data.DataReader} reader See doRequest#reader. * @param {Function} callback See doRequest#callback. * @param {Object} scope See doRequest#scope. * @param {Object} options See doRequest#options. * @param {Object} response The response from the DWR call. This should be an Object which can be converted to Ext.data.Records. * @private */ onRead : function(action, params, reader, callback, callbackScope, options, response) { var records; try { // Call readRecords verses read because read will attempt to decode the JSON, // but as this point DWR has already decoded the JSON. records = reader.readRecords(response); } catch(e) { // @deprecated: Fire loadexception for backwards compatibility. this.fireEvent("loadexception", this, params, response, e); t his.fireEvent('exception', this, 'response', action, params, response, e); callback.call(callbackScope, null, options, false); return; } this.fireEvent("load", this, params, options); callback.call(callbackScope, records, options, true); }, /** * Helper method for createCallback for handling the create, update, and delete actions. * This mirrors HttpProxy#onWrite * TODO: implement * @private */ onWrite : function() { throw new Exception('create, update, and delete actions are not implemented yet.') } });
发表评论
-
extjs grid设置某行字体颜色 行颜色
2010-05-19 21:42 1996.x-grid-record-red table{//字体 ... -
ext logon
2009-10-21 23:15 1156<html> <head> ... -
ext form 表单提交数据的方法小结
2009-10-21 22:13 1940EXT的form表单ajax提交(默认提交方式) fu ... -
封装Ext tree 扩展功能
2009-10-13 11:31 1083扩展的功能有: 1. 搜索过滤树节点(保留结构) 2. ... -
ext例子
2009-10-10 09:37 878http://www.myext.cn/ -
EXTjs 文件压缩
2009-09-24 21:08 1791之前曾使用过的办法有gzip(我记性不是很好,就是放在IIS中 ... -
解决Extjs文件太大的问题
2009-09-24 10:09 3615在使用Extjs过程中,ext-all.js文件太大,在网络环 ... -
ComboBoxTree
2009-07-25 22:34 3861参考别人的改的 Ext.namespace(" ... -
SearchField
2009-07-18 19:14 2597/* * Ext JS Library 2.1 * ... -
PagingToolbar PageSizePlugin
2009-07-18 14:10 2127/** * Page Size Plugin for ... -
PagingToolbar 扩展
2009-07-18 13:52 2321Ext.namespace('Ext.ux.PagingT ... -
一个扩展的 GridPanel
2009-07-14 14:43 1218分页后可保存checkbox的 ... -
ext 简易上传控件
2009-07-14 14:39 1792//*************************** ... -
extJs之下拉框联动
2009-07-14 14:37 1898// 第一个下拉框 var parentStore ... -
combtree
2009-07-14 14:34 1093var comboxWithTree = new Ext. ... -
ext treePanel 更换图标 总结
2009-07-14 14:33 71311.动态更换图标: 代码 node.on('click', ... -
EXT 一个panel与tree结合读数据库json格式的例子
2009-07-13 13:37 2945var Tree = Ext.tree; Ext.onR ... -
spket Eclipse 安装
2009-07-11 12:40 2320spket最好用了,而且它还支持ext,安装起来很简单.... ... -
ext3.0 ext direct
2009-07-11 11:14 3011具体的工程步骤: 首先,我们来搭建WEB服务端的程序: 这时, ... -
ext+dwr DynamicGridPanel 封装 态创建ext grid
2009-07-06 16:55 3720封装一个动态grid 继承Ext.grid.GridPanel ...
相关推荐
2. **创建DWRProxy**:在ExtJS中,我们需要创建一个DWRProxy实例,指定服务器端的Java类或接口。例如: ```javascript var proxy = new Ext.data.DWRProxy({ className: 'com.example.server.MyService' }); ``...
dwrproxy.js 博文链接:https://cicada-it.iteye.com/blog/102949
ExtJs中使用dwrproxy,和json来处理从数据库里查询出来的数据 其中dwrproxy还支持分页(分页功能没做),将war包下载下来后,直接放在tomcat里,然后启动tomcat就可以了 数据库方面,该项目里用的是mysql,数据文件在...
在实际应用中,DWRProxy.js和Ext2.0的结合还涉及到JSON数据格式的使用。JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,它易于人阅读和编写,同时也易于机器解析和生成。在DWR中,服务器端返回的...
11.17.2 扩展String......................... 306 11.17.3 扩展Function.................... 306 11.17.4 扩展Number......................... 308 11.17.5 扩展Array........................... 308 11.18 Ext....
本篇文章将深入探讨在Ext框架下,与DWR(Direct Web Remoting)集成所使用的三个关键JavaScript文件:`dwrproxy.js`、`DWRTreeLoader.js`和`PagingDWRProxy.js`。这些文件对于实现动态数据交互和页面组件的高效加载...
用EXT和DWR结合起来做工程时,在数据传输时会有点麻烦,这里提供的3个JS文件分别实现了DWR的数据代理,分页查询处理,动态树加载。并且实现了Ext.data.DWRArrayReader Ext.data.DWRXmlReader Ext.data....
Ext扩展dwrproxyExt扩展dwrproxyExt扩展dwrproxyExt扩展dwrproxyExt扩展dwrproxyExt扩展dwrproxyExt扩展dwrproxyExt扩展dwrproxyExt扩展dwrproxy
proxy: new Ext.data.DWRProxy('YourDWRMethod'), // 使用DWR方法作为数据源 reader: new Ext.data.JsonReader({ totalProperty: 'total', // DWR返回的总记录数字段 root: 'data', // 数据集字段 idProperty: ...
dwrProxy.js
6.3 元素常见的使用方法 6.3.1 常见的“显示/隐藏”方法 6.3.2 常见的“内容控制”方法 6.3.3 常见的“操控DOM”方法 6.3.4 常见的“尺寸大小/定位”方法 6.3.5 常见的“特效动画”方法 6.3.6 DomHelper简介 ...
D.2. 感谢[吧啦吧啦286556983]的大力支持 D.3. 感谢[游戏人生395181055]的大力支持 D.4. 感谢[綄帥77793603]的大力支持 D.5. 感谢[葡萄5793699]的大力支持 D.6. 感谢[天外小人442540141]的大力支持 D.7. 感谢[我想我...
4. **EXT3.0测试通过**: 这表明这些扩展已经在ExtJs 3.0版本上进行了充分的测试,证明了它们的兼容性和稳定性。ExtJs 3.0是一个成熟的版本,提供了丰富的组件和功能,广泛应用于企业级开发。 在实际应用中,这些...
6.3 元素常见的使用方法 6.3.1 常见的“显示/隐藏”方法 6.3.2 常见的“内容控制”方法 6.3.3 常见的“操控DOM”方法 6.3.4 常见的“尺寸大小/定位”方法 6.3.5 常见的“特效动画”方法 6.3.6 DomHelper简介 ...
A.2. 怎么查看ext2里的api文档 A.3. 如何在页面中引用ext A.3.1. 顺便说说常见的Ext is not defined错误 A.4. 想把弹出对话框单独拿出来用的看这里 A.5. 想把日期选择框单独拿出来用的看这里 A.6. 听说有人现在还...
EXT+DWR分页 ,前人基础修改,绝对能用 有问题的大家相互交流, 具体使用请参考我的文章EXT+DWR分页
EXT是一个强大的JavaScript库,用于构建富客户端应用,而DWRproxy则是EXT与服务器端交互的关键工具,它允许前端JavaScript代码能够调用服务器端的Java方法,实现了类似于Ajax的功能,但更为强大和灵活。 DWRproxy的...
EXTJS 3 整合DWR (DWRProxy、DWRTreeLoader、DWRGridProxy) 是一个在EXTJS 3.0版本中实现的重要技术整合,它将DWR(Direct Web Remoting)的强大功能引入到EXTJS的前端框架中,以实现更高效的数据交互。EXTJS是一个...
是Ext+Dwr+Spring的完美结合。 表格中的数据是通过DWRProxy加载共分3中形式,用以下3中解析器来解析的: DWRJsonReader DWRArrayReader DWRXmlReader 数据完全由JAVA方法返回,由DWR动态调用,利用了Spring作为Bean...
对于不常见的数据源和协议,可以通过自定义reader和proxy来扩展其功能,例如DWRProxy使得EXT能够直接与DWR(Direct Web Remoting)进行通信。 10.2 Ext.data.Connection Ext.data.Connection是Ext.lib.Ajax的封装,...