Stripes in TreeTable like in DataTable

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
simon.keel
Posts: 3
Joined: 12 Sep 2018, 12:16

24 May 2019, 17:40

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

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

27 May 2019, 10:34

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,

simon.keel
Posts: 3
Joined: 12 Sep 2018, 12:16

24 Jan 2020, 12:48

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

simon.keel
Posts: 3
Joined: 12 Sep 2018, 12:16

24 Jan 2020, 13:14

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..

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

30 Jan 2020, 15:30

Glad to hear, thanks a lot for the update!

Best Regards,

Post Reply

Return to “Paradise - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests