Ext复制grid里某一列的值

ExtAspNet确实封装Ext封装的不错,但是一些Ext的弊端还是有点影响它的完美!

第一个问题:Grid列的值不能选中,所以也就不能复制,这对于显示内容必然是个弊端。

解决方法:

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>'  
);  

第二个问题:DatePicker不能选择时分秒,如果你说可以是不是用到了DateFormatString,这个东东太忽悠人了。表面上是可以选择了,但是在通过后台数据设置它的值是怎么都显示不了值。

解决方案:不用datePicker获取时分秒,自己另外写个textbox加个正则获取设置吧。 

posted @ 2010-06-18 16:14  古道  阅读(684)  评论(0编辑  收藏  举报