hi,
I have an entity selection with records that have a “Completed” status (Yes/No). Depending on the status, I want to display the background either red or gray.
Is this possible using states?
If not, I was thinking of creating two different matrices — one showing all open items and one showing all completed items. However, in that case, I’d need the matrix to have a dynamic height so that it looks good.
And a “Virtuozo”: It’s a new component for dynamic heights depending on the content of each item: Release V0.1.0 · metayoub/qodly_Virtuoso. So, if you have an issue, you can submit an issue for it.
The important thing you need to do is: adding an attribute in your dataclass for color depending on the status. I give you an example:
You need to drag and drop a “virtuozo”, bind it with entity selection.
Inside the default stylebox, drag and drop a “stylishbox” and give it this parameter as a property. In this example, I give a red color as a default value if the source’s value is “null”:
Then, add a stylebox inside that stylishbox and then create a CSS class that will be associated to that stylebox. You can see that “BgColor” (which is inside the var()) is the name of the parameter that we configured it in the stylishbox:
And as you can see, we have items with dynamic heights, and also with different background colors depending on the status (100 = completed, else it’s in progress):
I think the missing thing is that you need to manage colors in a code function depending on your needs (except the color configured in the stylishbox).
In my example, if the status is “in progress”, here I give a fixed color. Else, the color is “null” which gives by default the color configured in the stylishbox:
If ($note.status="in progress")
$note.color:="#d1ccccff"
End if
mh, i have an extra field in my db called color_support and filled it with different colors. i created a new entity where color_support is null but its the same behaviour.
ah i got it. i’m not sure what the prob was. i have an entity selection under “namespace”. when i assign this entity selection to virtuozo and all the fields (bgColor…) then it does not work. Now i created a new entity selection and an entity unter “this page”, assigned the fields from this entity(selection) an now it works.
I confirm that there is an issue in the stylishbox, when we use it in a virtuozo or a matrix, it doesn’t work correctly with a shared qodly source, but works with a local qodly source.