无法在可调整大小的网格中选择文本
我需要具有可调整大小并允许用户选择单元格值的 Ext.panel.Grids (v6.2.0)。
我有一堆网格,我已将其设置为可调整大小:
resizable: {
pinned: true,
handles: 's'
}
现在的问题是,即使在表视图上进行覆盖......
Ext.override(Ext.view.Table, {
enableTextSelection: true
})
我无法再选择网格内的文本。如果我删除调整网格大小,则允许我选择记录值以供稍后复制和粘贴。
我也尝试过覆盖该列的enableTextSelection,但这仍然不起作用。
I need to have Ext.panel.Grids (v6.2.0) that are both resizable and allow users to select the cell values.
I have a bunch grids that I've set to be resizable with:
resizable: {
pinned: true,
handles: 's'
}
the problem now, even with overrides on the Table view...
Ext.override(Ext.view.Table, {
enableTextSelection: true
})
... I can no longer select the text within the grids. If I remove the resizing the grids allow me to select the record values to copy and paste later.
I've tried overriding the column's enableTextSelection, too, but that still didn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在网格的配置中添加了这个:
这将允许选择行。
II added this in the configuration of the grid:
This will allow to select the rows.
这似乎有效的唯一方法是重写 Ext.resizer.Resizer 的“构造函数”。我尝试只包含需要更改的部分,但最终使用了整个构造函数(https://docs.sencha.com/extjs/6.2.0/classic/src/Resizer.js.html) 在我的覆盖中,并在末尾添加以下内容:
并改变了为了安全起见,
下面的内容是强制网格的父 div 上的不可选择类并使整个 div 的内容不可选择。我尝试覆盖它的 CSS,并覆盖 Ext.column.Column 和 Ext.table.View,但这些都不起作用。
The the only way this seemed to work was to override Ext.resizer.Resizer's "constructor". I tried to just include the parts that needed to change, but I ended up using the whole constructor (https://docs.sencha.com/extjs/6.2.0/classic/src/Resizer.js.html) in my override and added the following at the end:
and changed the following just to be safe:
something in here was forcing the unselectable class on the parent div of the grid and making the whole div's contents unselectable. I tried overriding it CSS, and overriding the Ext.column.Column and Ext.table.View and none of that worked.