Search code examples
phpreactjssulu

How to add html class on each table row, for resources list view in Sulu admin UI


I've created entity, with controller and Admin class, form details and list.

Entities are correctly shown in one html table in Sulu admin area. The question is: is there a way to add html class on each row of this table? Based on entity value (status flag)


Solution

  • In sulu you are doing this not on a row level. Instead on a column level on a column level you have different "list transformers" you can create own list transformers as shown in the Sulu Demo here:

    https://github.com/sulu/sulu-demo/pull/80

    Or use existing list transformer. One option would be the "icon" list transformer.

    As example the activity log icon: https://github.com/sulu/sulu/blob/2.6.6/src/Sulu/Bundle/ActivityBundle/Resources/config/lists/activities.xml#L36-L80