在 ExtJS GridPanel 上使用 RowEditor 扩展时的显示问题
我正在使用 RowEditor 扩展来编辑 GridPanel。我的ExtJS版本是3.3.0。我需要一些字段可编辑,其他字段则根本不可编辑,我通过忽略这些列上的 editor
属性来做到这一点。问题是,当找不到编辑器时,它是在 RowEditor.js
这样:
for(var i = 0, len = cm.getColumnCount(); i < len; i++){
var c = cm.getColumnAt(i),
ed = c.getEditor();
if(!ed){
ed = c.displayEditor || new Ext.form.DisplayField();
}else{
ed = ed.field;
}
//uninteresting code...
this.insert(i, ed);
}
数据会因此双重显示,如下图所示。
是否有一种快速解决方案可以删除不必要的文本,但仍然可以查看网格上的现有数据?提前致谢。
I'm using the RowEditor extension to edit a GridPanel. My ExtJS version is 3.3.0. I need some fields to be editable, others not no be edited at all and I do this by ignoring the editor
property on those columns. The problem is that when an editor is not found, it is artificially generated in RowEditor.js
this way:
for(var i = 0, len = cm.getColumnCount(); i < len; i++){
var c = cm.getColumnAt(i),
ed = c.getEditor();
if(!ed){
ed = c.displayEditor || new Ext.form.DisplayField();
}else{
ed = ed.field;
}
//uninteresting code...
this.insert(i, ed);
}
The data is double displayed because of that, as you can see in the image below.
Is there a quick solution to get rid of that unnecessary text but still view the existing data on the grid? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我要断言,不。除非重写部分插件。话又说回来,您也许可以手动循环您不想要的控件并隐藏它们..但这似乎是错误的。
老实说,我不想使用 rowEditor 插件。拥有“常规”编辑器也同样简单(甚至可能与迄今为止您用来指定编辑器的代码相同)。
然后,正如您已经完成的那样,您只需忽略不需要的列的
editor
选项即可。如果您想拥有更奇特的外观,可以尝试对所选行进行样式设计(Ext.NET 中的 GetRowClass ,类似于 ExtJS?或者只是覆盖所选行的 CSS 类)。
I'm going to posit, no. Not without rewriting part of the plugin. Then again, you may be able to manually loop round the controls you don't want and hide them.. but that seems wrong.
I'd honestly just do without the rowEditor plugin. It's just as simple to have 'regular' editors (probably even same code you've used to specify editors thus far).
Then, again as you've already done, you just ignore the
editor
option of the columns you don't need.If you want to have a more fancy look, you could try styling your selected row (
GetRowClass
in Ext.NET, similar in ExtJS? Or just override the CSS class of a selected row).