Command Button Colors inside Datatable

Post Reply
glaydsongmv
Posts: 3
Joined: 25 Mar 2018, 04:55

04 Feb 2019, 17:52

How to change button colors inside datatable? If I set colors in the button still the blue color of the theme (default). Outside datatable button colors works fine.

aragorn
Posts: 3762
Joined: 29 Jun 2013, 12:38

06 Feb 2019, 14:30

Please try;

Code: Select all

body .ui-datatable tbody.ui-datatable-data .ui-button.ui-state-default {
   background: red;
    border-bottom: 5px solid blue;
}

body .ui-datatable tbody.ui-datatable-data .ui-button.ui-state-hover {
   background: yellow;
}

glaydsongmv
Posts: 3
Joined: 25 Mar 2018, 04:55

06 Feb 2019, 14:41

Hi,

This code works coloring all buttons inside a datatable with the same color (red). I'm trying to use custom colors in different buttons with a tag styleClass="red-button" (for example).

Thanks.

aragorn
Posts: 3762
Joined: 29 Jun 2013, 12:38

07 Feb 2019, 08:16

Glad to hear, thanks a lot for the update!

Code: Select all

body .ui-datatable tbody.ui-datatable-data .red-button.ui-button.ui-state-default {
   background: red;
    border-bottom: 5px solid blue;
}

body .ui-datatable tbody.ui-datatable-data .red-button.ui-button.ui-state-hover {
   background: yellow;
}

aragorn
Posts: 3762
Joined: 29 Jun 2013, 12:38

23 Oct 2019, 10:01

Hi,

I think you can use $('ELEMENT_SELECTOR').focus() method or add a custom class to element to focus on. Exp; <p:commandButton ... oncomplete="$('ELEMENT_SELECTOR').focus()">

Best Regards,

Post Reply

Return to “Icarus”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests