FacundoGFlores FacundoGFlores - 1 month ago 68
Sass (Sass) Question

Unselect first row search in ng2-smart-table

Is there any way to unselect the first row in ng2-smart-table? Note once it is loaded the first row always has the

selected
class. The thing is I want to add a
hover
in a
.scss
file to change the background, but it never changes the first one, but all of the reamining rows can change background.

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


Look at this example, the first row has a background when it is loaded.

EDIT:

Looking at the source it seems to select it arbitrary:

data-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;
}

Answer

Add !important to override the the styling from the selected class

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