文本选择在单元格 - ng2表格上不起作用 [英] Text Selection is not working on Single Cell - ng2-table

查看:201
本文介绍了文本选择在单元格 - ng2表格上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



http://valor-software.com/ng2-table/

这是Demo。



我尝试通过鼠标单击和拖动(!important - 在单个单元格内部,多个单元格正在工作)来选择单个单元格中的文本。在Chrome上工作,而不是在Mozila FireFox上工作。但现在它也不适用于Chrome。



更多信息如下。

 < tr * ngFor =让行的行数>> 
< td(click)=cellClick(row,column.name)* ngFor =让列的列[innerHtml] =sanitize(getData(row,column.name))>< ; / TD>
< / tr>
$ b $ public cellClick(row:any,column:any):void {
this.cellClicked.emit({row,column});
}

这是单元格点击的功能。
用户鼠标向下,鼠标移动,最后是鼠标移动。
此时,此功能被触发,选择正在消失。



请帮我解决这个问题。

解决方案

我通过更新这个部分解决了这个问题。

 < td(click)=cellClick(row,column.name)* ngFor =让列的列[innerHtml] =getData(row,column.name)> < / TD> 

它使用Sanitize来构建HTML内联代码。


Here is Data Table for angular2, written by Valor software.

http://valor-software.com/ng2-table/

And this is Demo.

I tried to select text in single cell by mouse click and drag (!important - inside single cell. on multiple cell is working) It was working on Chrome and not working on Mozila FireFox. But now its is not works on Chrome too.

Further information is below.

<tr *ngFor="let row of rows">
   <td (click)="cellClick(row, column.name)" *ngFor="let column of columns" [innerHtml]="sanitize(getData(row, column.name))"></td>
</tr>

public cellClick(row:any, column:any):void {
   this.cellClicked.emit({row, column});
}

This is the function for table cell clicked. User mouse down, and mouse move, and finally mouseup. At this time, this function is triggered and selection is disappearing.

Please help me to solve this issue.

解决方案

I solved this issue by updating this part.

<td (click)="cellClick(row, column.name)" *ngFor="let column of columns" [innerHtml]="getData(row, column.name)"></td>

It was using Sanitize for building html inline code.

这篇关于文本选择在单元格 - ng2表格上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆