[MGNLUI-3584] Ability to dynamically style cells and rows in tree and list views Created: 14/Sep/15 Updated: 08/Mar/21 Resolved: 08/Mar/21 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | workbench |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Neutral |
| Reporter: | Magnolia International | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | next, ux | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Patch included: |
Yes
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Date of First Response: | |||||||||
| Description |
|
If one wants to style a cell or a complete row of a tree or list, the possibilities are limited to using a ColumnFormatter and wrap the data in a <span>. This works to a certain extent, but is not elegant. Styling an entire row (e.g grey it out based on the status of the node) is only doable using nasty javascript tricks. With the attached patch, we would allow developers to configure CellStyleGenerator at table/list level (to be used for styling rows) and at column level (to style cells). |
| Comments |
| Comment by Magnolia International [ 14/Sep/15 ] |
|
In this second version of the patch, we have configurability, but it shows a two-sided problem: StyleGenerators are a tad "complex" to write, and without lots of conditional statements, they unintuitively get applied to more rows or columns than necessary. Additionally, Vaadin seems to prefix the returned styles string with v-table-cell-content- or v-table-row-, which I also find counter intuitive. (especially since we potentially want to add several styles, and vaadin only prefixes the first (i.e it doesnt "parse" the returned space-separated string before prefixing)) |
| Comment by Roman Kovařík [ 08/Mar/21 ] |
|
In the new framework it's possible to set styleGenerator on grid. No plan to expose this via config. |