繁体   English   中英

ExtJS 具有功能的网格。分组和编辑插件。具有组合或标签字段的单元格编辑器在单击组时不会关闭编辑器

[英]ExtJS grid with feature.Grouping and editing plugin.cellediting that has combo or tagfield will not close editor when click on groups

我正在使用带有“cellediting”插件和“分组”功能的 Ext.grid.Panel。 我的编辑器是一个标签域。 我开始编辑该字段,然后在关闭选择列表(边界列表)之前单击组标题(以触发模糊事件)

  1. 标签输入被隐藏但它的绑定列表没有(如果点击当前组)
  2. 标签输入移到顶部(如果单击顶部组)

Sencha Fiddle 直播预览: https://fiddle.sencha.com/#view/editor&fiddle/3ll2

展开标签域

  • 点击上面的组。 点击上面的组

  • 单击当前行所属的组。 点击当前组

我当前的修复:

Ext.define("Ext.fix.grid.feature.Grouping", {
    override: 'Ext.grid.feature.Grouping',

    afterViewRender: function(view) {
        // without callParent the problem is not reproduced,
        // but colapse/expand is not working
        this.callParent(arguments);

        if (view.editingPlugin) {
            view.on({
                beforegroupclick: function(grid) {
                    view.editingPlugin.completeEdit();
                }
            })
        }
    }
});

问题似乎是在分组时焦点不会丢失在标签字段上。 试试这个解决方法:在你的网格中添加一个监听器:

listeners: {
    groupclick: function (vw, node, group, e, opts) {
                this.focus();
                }
}

这将移除标记域上的焦点并强制它折叠。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM