加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 如何在启用行选择的角度ui网格中启用文本选择

发布时间:2020-12-17 06:53:24 所属栏目:安全 来源:网络整理
导读:我正在使用ui-grid v3.1.1并启用了rowSelection.我注意到当我启用行选择时,我无法再从行中选择(单击 – 按住 – 拖动)文本. 我在他们的教程(页面上的第二个网格)中注意到example中的相同行为. 很高兴知道在启用rowSelection的同时,我仍然可以允许用户选择文
我正在使用ui-grid v3.1.1并启用了rowSelection.我注意到当我启用行选择时,我无法再从行中选择(单击 – 按住 – 拖动)文本.

我在他们的教程(页面上的第二个网格)中注意到example中的相同行为.

很高兴知道在启用rowSelection的同时,我仍然可以允许用户选择文本.

Here是教程中示例的插件链接.

$scope.gridOptions = { 
     enableRowSelection: true,enableRowHeaderSelection: false 
};

解决方法

A previous SO answer by @Aman Mahajan提供修复:

当enableRowSelection和enableFullRowSelection都被启用时,ui-grid-disable-selection类被添加到网格中(可以检查ui-grid v3.1.1 source in selection.js~行903).因此,您可以通过向网格添加特定类来覆盖CSS类,例如ui-grid-selectable.

<div ui-grid="gridOptions" ui-grid-selection class="grid ui-grid-selectable"></div>

在你的CSS中:

.ui-grid-selectable .ui-grid-disable-selection {
     -webkit-touch-callout: default;
     -webkit-user-select: text;
     -khtml-user-select: text;
     -moz-user-select: text;
     -ms-user-select: text;
     user-select: text;
     cursor:auto;
 }

这是the forked plunker with the added CSS class以覆盖默认行为.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读