Genie Discord forum

Author Avatarjeremiedb
9/18/2023, 11:12:46 PM

Is there a functionnality allowing the display of icons within a Stipple / Quasar tables?

For example an initial take was to write the actual html for q-icon within a DataFrame column: df.icon .= """<q-icon name="warning" color="warning" size="1rem"/>""" The rendering however results in the raw string as shown in attached image. Is there a way to request string to be parsed as html? Or other trick to populate a Stipple Table cells with icons?

Author AvatarPere
9/22/2023, 7:43:38 AM

We're not sure about this one, we'd need to see what's possible with pure Quasar and how it is done. Perhaps we'd need to use Quasar slots

Author Avatarjeremiedb
9/26/2023, 1:20:30 AM

I looked at a more manual generation with @recur but without luck so far. Assuming the following vector of icon names in the model: icons3::R{Vector{String}} = ["check_box", "warning", "error"]

Is it expected that none of the 2 follwoing approches work (the page only renders "null")?:

  1. StippleUI.icon("{{ item }}", @recur(:"item in icons3"))
  2. p(StippleUI.icon("{{ item }}"), @recur(:"item in icons3"))

However, the 2 following work fine: 3. [icon(_icon, color="red") for _icon in model.icons3[]] 4. ["""<q-icon name=$(icon)></q-icon>""" for icon in model.icons3[]]

It's possible to get a workaround with 3 & 4, but wondered if 1 and 2 not rendering might be a bug?

Author AvatarPere
9/26/2023, 3:03:49 PM

The issue is with the use of the null syntax, which doesn't work anymore

This code should work:

using GenieFramework
@app begin
    @out icons3 = ["check_box", "warning", "error"]

ui() = StippleUI.icon(:item, @recur(:"item in icons3"))
@page("/", ui)
Author Avatarjeremiedb
9/26/2023, 8:44:30 PM

This works like a charm!

I didn't suspected the "null" to be the issue as the following resulted in valid output:

span("{{_icon}}", @recur(:"_icon in icons3"))

Thank you so much for the help, very appreciated!