How to mark EditableGrid Header in BOLD

Hi,

I have an editable grid where I have some columns with headers (i.e a!gridLayoutHeaderCell(label: "HEADER",align: "CENTER")). I am trying to mark header label in BOLD (i.e HEADER). I have already tried richtext, no luck.

Please help me with it.

Thanks

Shamim Ahmad

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    There's currently no way to do *exactly* this (edit: David has provided a neat workaround below, which might work for you).  Column headers for both types of grid are only able to use their built-in formatting.

    I agree it might be nice if the grid header function was updated to accept a a!richTextItem() object instead of just plaintext, which would open up some fun new possibilities, but I don't expect this is even on Appian's priority radar at the moment.

  • 0
    Certified Lead Developer

    Unicode bold letters start at 119808.

    So char(119808) should render a capital A in bold.  code("A") gives you 65.  So, you need to add 119743 to each of your letters to make them bold.  Unless they're spaces or punctuation.

    This gets you ALL CAPS, but the lower case letters aren't in the same relative position on both ends of the unicode standard.  So you have to adjust the starting point for the list of lowercase letters, and the number you have to add.

    joinarray(
      a!forEach(
        items: code(ri!text),
        expression: if(
          and(fv!item > 64, fv!item < 91),
          char(fv!item + 119743),
          if(
            and(fv!item > 96, fv!item < 123),
            char(fv!item + 119737),
            char(fv!item)
          )
        )
      )
    )

  • 0
    Certified Lead Developer
    in reply to Dave Lewis

    This is a neat workaround (which i've heard before but keep forgetting about); anyone who uses this trick though, i'd encourage to just create an expression rule (the code posted above looks like it would be all you need in this rule), into which you can pass your desired text and it passes out the unicode equivalent -- hardcoding this into various forms is asking for trouble if and when Appian functionality is updated in the future.

  • 0
    Certified Lead Developer
    in reply to Mike Schmitt

    Yeah, forgot to mention that.  I made a rule (many times now) called FancyText.  You can store the magic numbers as constants, too, and play around with them.  There's a lot in that unicode block that can be used to basically trick Appian into utilizing other fonts.  You just wrap the text you want to change in the FancyText rule.

  • 0
    Certified Lead Developer
    in reply to Dave Lewis

    Yeah, before Rich Text Icons were a thing I'd created unicode character rules to give me the "floppy disk (save)" icon, the "opens in new tab" arrow, etc.  But mainly I'm just glad those days are mostly behind us, now that paging grids can use rich text within grid cells (but not headers, as mentioned by OP).