点击编辑 CFGRID
我一直在到处寻找这个问题,只发现我的问题已经有一段时间没有得到解答了。
使用 ColdFusion 8 的 cfgrid 标签。默认情况下,编辑模式要求您双击单元格以呈现编辑模式。为什么?我不明白。
现在,我想做的是将点击量更改为 1 而不是 2。
我查看了 EXT-JS 文档,它是网格的 clicksToEdit;但是,我还没有找到一种方法...无需编辑基本 grid.js 文件即可单击一次。
我不想编辑核心文件来完成此任务。有什么建议吗?
这是我的代码......
init = function(){
//grid object
grid = ColdFusion.Grid.getGridObject('ActivityGrid');
//column model
cm = grid.getColumnModel();
//we need to know the column id
entIndex = cm.findColumnIndex("DATE_START");
intIndex = cm.findColumnIndex("DATE_END");
var ef = new Ext.form.DateField(
{
format: 'm/d/Y',
minValue: '1/01/11'
}
);
//set format for the cell
cm.setEditor(entIndex, new Ext.grid.GridEditor(ef));
cm.setEditor(intIndex, new Ext.grid.GridEditor(ef));
//set render for the cell
cm.setRenderer(entIndex, Ext.util.Format.dateRenderer('m/d/Y'));
cm.setRenderer(intIndex, Ext.util.Format.dateRenderer('m/d/Y'));
grid.reconfigure(grid.getDataSource(),cm);
}
I have been searching all over the place for this and only found my question which has gone unanswer for sometime.
Using ColdFusion 8's cfgrid tag. By default, the edit mode requires you to double-click on a cell to render edit mode. Why? I don't get it.
Now, what I would like to do is change the click amount to 1 instead of two.
I looked in the EXT-JS documentation and it is clicksToEdit for the grid; however, I have yet to find a way...without editing the base grid.js file to make it a single click.
I dont want to edit the core files to accomplish this. Any suggestions?
Here is my code....
init = function(){
//grid object
grid = ColdFusion.Grid.getGridObject('ActivityGrid');
//column model
cm = grid.getColumnModel();
//we need to know the column id
entIndex = cm.findColumnIndex("DATE_START");
intIndex = cm.findColumnIndex("DATE_END");
var ef = new Ext.form.DateField(
{
format: 'm/d/Y',
minValue: '1/01/11'
}
);
//set format for the cell
cm.setEditor(entIndex, new Ext.grid.GridEditor(ef));
cm.setEditor(intIndex, new Ext.grid.GridEditor(ef));
//set render for the cell
cm.setRenderer(entIndex, Ext.util.Format.dateRenderer('m/d/Y'));
cm.setRenderer(intIndex, Ext.util.Format.dateRenderer('m/d/Y'));
grid.reconfigure(grid.getDataSource(),cm);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用具有无界网格的 Ext JS 3.0,
grid.getDataSource()
会抛出错误解决方法是使用
grid.getStore()
因此,将行替换
为
With Ext JS 3.0 with unbounded grid,
grid.getDataSource()
throw an errorThe workaround is to use
grid.getStore()
So, replace line
with