Sarz
Sarz

Reputation: 1976

Add Label and Custom CSS on `Primefaces:dashboard` Component

I am working on https://www.primefaces.org/showcase/ui/panel/dashboard.xhtml

Here i want to modify the UI and apply CSS

I've tried using, but it is apply on all dashboards

.ui-dashboard-column::before{
  font-weight: bold;
  color: navy;
  content: "Todo List. ";
}

Upvotes: 0

Views: 296

Answers (1)

Selaron
Selaron

Reputation: 6184

In your procedure defining the DashBoardModel you can set a styleClass per column:

DefaultDashboardColumn column1 = new DefaultDashboardColumn();
// ...
column1.setStyleClass("todo")
model.addColumn(column1);

Then use this styleClass with your css selector:

.ui-dashboard-column.todo::before{
 ...
}

see also

Upvotes: 2

Related Questions