Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在gwt中单击单元格表中的一行时,鼠标悬停样式将被删除_Gwt - Fatal编程技术网

在gwt中单击单元格表中的一行时,鼠标悬停样式将被删除

在gwt中单击单元格表中的一行时,鼠标悬停样式将被删除,gwt,Gwt,目前,我正在使用下面的代码片段应用鼠标悬停样式来突出显示celltable的行 int rowCount = this.getRowCount(); for(int i=0; i<rowCount; i++){ TableRowElement rowElement = this.getRowElement(i); rowElement.addClassName("selected-row"); } .selected-row

目前,我正在使用下面的代码片段应用鼠标悬停样式来突出显示celltable的行

int rowCount = this.getRowCount();
for(int i=0; i<rowCount; i++){
            TableRowElement rowElement = this.getRowElement(i);
            rowElement.addClassName("selected-row");
        }

.selected-row:hover{
  background-color: #DFE8F6;
}
int rowCount=this.getRowCount();

对于(int i=0;i当您单击一行时,表格将刷新,这将删除您的样式


GWT已将特殊样式应用于所选行。如果您不喜欢它的外观,您可以覆盖GWT的CSS类,而不是尝试添加您自己的样式。

我也会在鼠标按下事件中添加背景色