2016-10-04 67 views
0

有什麼方法可以取消選擇ng2-smart-table中的第一行?注意一旦它被加載,第一行總是有selected類。事情是我想在.scss文件中添加一個hover來更改背景,但它不會更改第一個背景,但所有剩餘行都可以更改背景。在ng2-smart-table中取消選擇第一行搜索

tbody { 
    tr:hover { 
     background: #209e91; 
    } 
} 

看看this舉例,第一行在加載時有背景。

編輯:

查看源似乎將其選中任意:

數據set.ts

protected willSelect: string = 'first'; 
    ... 
    select(): Row { 
    if (this.getRows().length === 0) { 
     return; 
    } 
    if (this.willSelect) { 
     if (this.willSelect === 'first') { 
     this.selectFirstRow(); 
     } 
     if (this.willSelect === 'last') { 
     this.selectLastRow(); 
     } 
     this.willSelect = ''; 
    } else { 
     this.selectFirstRow(); 
    } 

    return this.selectedRow; 
    } 

回答

1

添加!importantselected類覆蓋了造型

tbody tr:hover { 
    background: #209e91 !important; 
}