Page 1 of 1

Stripes in TreeTable like in DataTable

Posted: 24 May 2019, 17:40
by simon.keel
Hi there

How can i get the nice stripes (white row and then gray row) for the TreeTable like it is in the DataTable for the demo app?

Thanks and best

Simon

Re: Stripes in TreeTable like in DataTable

Posted: 27 May 2019, 10:34
by mert.sincan
Hi Simon,

For now, this feature is not supported by TreeTable component because of the structure of Treetable. I added a new enhancement to elite versions(7.0.4 and 6.2.21) and community version(7.1) to fix this issue. After releasing these versions, please use the following scss codes in Paradise;

Code: Select all

.ui-treetable {
    .ui-treetable-data {
        tr {
            @for $i from 1 through 10 {
                &.node-level-#{$i} {
                    &:nth-child(odd):not(.ui-state-highlight) {
                        background-color: $contentBgColor;
                    }

                    &:nth-child(even):not(.ui-state-highlight) {
                        background-color: $datableEvenRowBgColor;
                    }
                }
            }
        }
    }
}
Note: The above code can be added into _theme_styles.scss file.

Best Regards,

Re: Stripes in TreeTable like in DataTable

Posted: 24 Jan 2020, 12:48
by simon.keel
Hi mertsincan

Thanks a lot for the fix. I assume this should work with primefaces 8.0.RC2 and the paradise 2.0, right? Is there any special setting i need to put or does it work out-of-the box?

best

Simon

Re: Stripes in TreeTable like in DataTable

Posted: 24 Jan 2020, 13:14
by simon.keel
this works for me:

Code: Select all

.ui-treetable {
    .ui-treetable-data {
        tr {
            &:nth-child(odd):not(.ui-state-highlight) {
                background-color: $contentBgColor;
            }
            &:nth-child(even):not(.ui-state-highlight) {
                background-color: $datableEvenRowBgColor;
            }
        }
    }
}
not quite sure why yours is not in my case..

Re: Stripes in TreeTable like in DataTable

Posted: 30 Jan 2020, 15:30
by mert.sincan
Glad to hear, thanks a lot for the update!

Best Regards,