extjs的gridpanel的数据内容不能复制解决方法
来源:互联网 发布:cepii数据库 编辑:程序博客网 时间:2024/05/16 04:41
Ext.grid.GridPanel有一个重大缺陷,就是单元格的内容不能选中,没法选中就没法复制,给用户带来很多不便。
分析: 用IE Developer Toolbar打开ExtJs输出的代码研究了一下,发现每个单元格的div都有一个属性:unselectable="on",看来是css在作怪。
版本: 2.2(版本3.2.1测试通过)
解决办法: extJs官方论坛上有具体的解决办法,比较可行的如下。
step1:添加新的css样式。
CSS代码
- <style type= "text/css" >
- .x-selectable, .x-selectable * {
- -moz-user-select: text! important ;
- -khtml-user-select: text! important ;
- }
- </style>
step2:修改Ext.grid.GridPanel的protoType,我是自己写了一个新的js文件,记得要在ext-all.js后面引入。
JavaScript代码
- if (!Ext.grid.GridView.prototype.templates) {
- Ext.grid.GridView.prototype.templates = {};
- }
- Ext.grid.GridView.prototype.templates.cell = new Ext.Template(
- '<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} x-selectable {css}" style="{style}" tabIndex="0" {cellAttr}>' ,
- '<div class="x-grid3-cell-inner x-grid3-col-{id}" {attr}>{value}</div>' ,
- '</td>'
- );
done!现在GridPanel的单元格可以选中了。
出处:http://blog.csdn.net/dy_paradise/archive/2010/01/19/5212389.aspx
0 0
- extjs的gridpanel的数据内容不能复制解决方法
- extjs的gridpanel的数据内容不能复制解决方法
- extjs的gridpanel的数据内容不能复制解决办法
- extjs的gridpanel的数据内容不能复制解决办法
- ExtJS gridPanel文本不能复制的解决办法
- ExtJs的Ext.grid.GridPanel不能选择复制表格中的内容解决方案
- ExtJs的Ext.grid.GridPanel不能选择复制表格中的内容解决方案
- 修改extjs源码真正解决:ExtJs4.0 GridPanel 数据内容不能选中复制。
- ExtJs GridPanel单元格不能选中复制
- ExtJs GridPanel单元格不能选中复制
- ExtJs GridPanel单元格不能选中复制
- ExtJS gridPanel因数据字段id值相同而显示不全的解决方法
- ExtJS gridPanel因数据字段id值相同而显示不全的解决方法
- ExtJS 简单的gridpanel
- Extjs控制GridPanel中特定单元格的内容及样式
- ExtJs疑难杂症之GridPanel单元格不能选中复制问题
- ExtJs疑难杂症之GridPanel单元格不能选中复制问题
- ExtJs疑难杂症之GridPanel单元格不能选中复制问题
- android手机测试”
- Android之SurfaceView实现视频播放
- Python decorator(装饰器)
- SPI时序
- 信号量函数知多少
- extjs的gridpanel的数据内容不能复制解决方法
- android 程序连接指定wifi
- 中国黑客传说:游走在黑暗中的精灵
- 继中国好声音、中国好舞蹈后中国好sql出炉了。
- struts1.3的自动验证插件
- css&div 学习笔记
- 存储过程的原理和实战应用
- Django编写后台报错
- Manifest