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>'
);
Ext复制grid里某一列的值
最新推荐文章于 2014-08-04 13:20:03 发布