Page 1 of 1

Ionic 4 - DataTable - Selected row styling - background-color

Posted: Wed Apr 01, 2020 10:37 am
by Dupdroid

How do I customise the background-color of the DataTable's selected/active row?

Inspect Elements Styles:

.ngx-datatable.material.single-selection .datatable-body-row.active, .ngx-datatable.material.single-selection .datatable-body-row.active .datatable-row-group, .ngx-datatable.material.multi-selection .datatable-body-row.active, .ngx-datatable.material.multi-selection .datatable-body-row.active .datatable-row-group, .ngx-datatable.material.multi-click-selection .datatable-body-row.active, .ngx-datatable.material.multi-click-selection .datatable-body-row.active .datatable-row-group {
background-color: #304ffe;
color: #fff;
}


Ionic 4 - DataTable - Selected row styling - background-color

Posted: Wed Apr 01, 2020 8:09 pm
by Serhii Kulibaba

Hello,

What do you mean with "the active row"? the row with the focused component or hovered by the pointer?


Ionic 4 - DataTable - Selected row styling - background-color

Posted: Thu Apr 02, 2020 8:58 am
by Dupdroid

When you click on a row to make it selected.

See this tutorial: https://docs.appery.io/docs/ionic-4-n...

The default colour is blue when a row has been selected.


Ionic 4 - DataTable - Selected row styling - background-color

Posted: Thu Apr 02, 2020 3:57 pm
by Dupdroid

Please, can I get some help here?


Ionic 4 - DataTable - Selected row styling - background-color

Posted: Sat Apr 04, 2020 1:39 pm
by Dupdroid

FYI

:host
::ng-deep
.ngx-datatable.material:not(.cell-selection)
.datatable-body-row.active
.datatable-row-group{
background-color: #BFE222;
}


Ionic 4 - DataTable - Selected row styling - background-color

Posted: Tue Apr 07, 2020 1:03 pm
by Galyna Abramovych

Thank you for sharing this information with our community!