Is it possible to user richtextfield control inside gridlayout header?

Certified Associate Developer

Hello All,

 

I have a requirement to display grid header cell in some specific format, So just wanted to know if we can use richtextfield control inside gridlayout field or not? If yes, Then how and if no then do we have any alternatives for it?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    RichTextField Cannot be used in header cells but there is a work around to achieve it. Leave the actual header cells as empty and make a static rowlayout to give headers for the grid using richtextfield inside the rowlayout. You can have additional row layouts for the grid values. But here the disadvantage is you will see a blank header on the first row of the grid.

    Example Code:

    a!gridLayout(headerCells:{a!gridLayoutHeaderCell(

     label:""

    ),

    a!gridLayoutHeaderCell(

     label:""

    )},

    rows:{

     a!gridRowLayout(

    contents:{a!richTextDisplayField(

      value:a!richTextItem(text:"Name",style:"STRONG")

    ),

    a!richTextDisplayField(

      value:a!richTextItem(text:"Address",style:"STRONG")

    )}

    ),

    a!gridRowLayout(

    contents:{a!textField(

      value:"Test Name"

    ),

    a!textField(

      value:"Test Address"

    )}

    )

    }

    )

     

Reply
  • 0
    Certified Lead Developer

    RichTextField Cannot be used in header cells but there is a work around to achieve it. Leave the actual header cells as empty and make a static rowlayout to give headers for the grid using richtextfield inside the rowlayout. You can have additional row layouts for the grid values. But here the disadvantage is you will see a blank header on the first row of the grid.

    Example Code:

    a!gridLayout(headerCells:{a!gridLayoutHeaderCell(

     label:""

    ),

    a!gridLayoutHeaderCell(

     label:""

    )},

    rows:{

     a!gridRowLayout(

    contents:{a!richTextDisplayField(

      value:a!richTextItem(text:"Name",style:"STRONG")

    ),

    a!richTextDisplayField(

      value:a!richTextItem(text:"Address",style:"STRONG")

    )}

    ),

    a!gridRowLayout(

    contents:{a!textField(

      value:"Test Name"

    ),

    a!textField(

      value:"Test Address"

    )}

    )

    }

    )

     

Children