RowEditing总结
来源:互联网 发布:php接口interface 编辑:程序博客网 时间:2024/06/14 07:06
1.与reconfigure事件的冲突问题
假如你的gridpanel要支持动态表头和数据,那么很可能会用到reconfigure,郁闷的是这时候会发现调用reconfigure无法成功,后台报错找不到column.hasEditor()函数。原因是reconfigure之后column的eidtor发生了变化,而RowEditing插件并未随之做出相应调整。解决办法:在grid的beforereconfigure事件中销毁原有的editor
参考文章:http://stackoverflow.com/questions/11963870/using-ext-grid-panel-reconfigure-breaks-the-grids-rowediting-plugin
*原文的解决方案是监听reconfigure事件,测试发现无效,不知道那哥们怎么弄的。
/**
* 解决rowEditing和reconfig冲突的问题
* @event beforeReconfigure
* Fires before a reconfigure.
* @param {Ext.grid.Panel} this
* @param {Ext.data.Store} store The store that was passed to the {@link #method-reconfigure} method
* @param {Object[]} columns The column configs that were passed to the {@link #method-reconfigure} method
*/
beforeReconfigure: function (grid, store, columnConfigs) {
var columns = grid.headerCt.getGridColumns(),
rowEditingPlugin = grid.findPlugin('rowediting');
//
// Re-attached the 'getField' and 'setField' extension methods to each column
//
rowEditingPlugin.initFieldAccessors(columns);
//
// Re-create the actual editor (the UI component within the 'RowEditing' plugin itself)
//
// 1. Destroy and make sure we aren't holding a reference to it.
//
Ext.destroy(rowEditingPlugin.editor);
rowEditingPlugin.editor = null;
//
// 2. This method has some lazy load logic built into it and will initialize a new row editor.
//
rowEditingPlugin.getEditor();
}
2.edit事件:function(editor, context, eOpts)
一般来说在使用RowEditing控件的场景下会希望仅仅向后台提交值发生变化的列,刚开始用了context.record.modified,发现取到的值是grid中最终显示的值即textField,对于combobox、checkbox这类“表里不一”的控件来说就不合适了,我们需要提交的是它的valueField。幸好它还有个表兄弟context.record.getChanges(),这货获取的是货真价实的valueField!
- RowEditing总结
- RowEditing中的 e.RowIndex
- GridView“gv_Info”激发了未处理的事件“RowEditing” “RowEditing”
- GridView DropDownList 数据 绑定 RowEditing
- Ext4.01 plugin RowEditing debug
- easyui datagrid rowediting使用心得
- ext gridpanel plugin rowediting编辑保存
- Extjs4 RowEditing 的使用和更新方法
- RowEditing 使用(示例) 按钮显示文字更改
- Ext4的direct+grid+RowEditing在ie中的奇怪问题
- 编辑Grid时用Ext.grid.plugin.RowEditing 插件
- Extjs4---用RowEditing对数据进行增加,修改
- Easyui.datagrid扩展——Ext.grid rowediting风格
- Extjs4---用RowEditing对数据进行增加,修改
- Extjs4.2.1 Ext.grid.plugin.RowEditing 保存按钮不可用
- ExtJS4.2学习基于表格的扩展插件---rowEditing
- extjs 解决rowEditing不满足allowBlank时,无法save的问题
- 如何在RowEditing中使用TextArea时回车可以换行
- 如何编写bat文件并打包java项目
- 自定义UITabBarController
- 元素垂直居中与hover失效
- android 在布局上绘制大量的基本的集合图形。
- Qt中QString,int,char,QByteArray之间相互转换
- RowEditing总结
- javamail实例之获取邮件,包括gmail yahoo
- 网站出现403 Forbidden
- hdu4865(概率DP)
- [hdu 5072]Coprime 数论-莫比乌斯反演
- 【整理】Python中的re.search和re.findall之间的区别和联系 + re.finall中带命名的组,不带命名的组,非捕获的组,没有分组四种类型之间的区别
- 第九周上机项目六穷举法解决组合问题(1)
- javax.servlet.jsp.jspexception cannot be resolved to a type
- Cocos2d-x 游戏开发中读取XML文件拷贝