Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    StaticTextItem width to text value

    We have several StaticTextItems that we use for links by setting the items' styles to mimic the look of a link, including setting cursor:hand.

    This works. However, the area to the right of the item's value is clickable and the cursor changes to a hand there as well.

    Is there a way to automatically set the width of a StaticTextItem to the width of its value so that the user does not accidentally click white space and gets taken to a different page?

    SmartGWT Power 4.0p 2014-01-15, GWT 2.5.1, FF 26

    #2
    Were you aware there's a LinkItem? It could do this for you, and actually have the link be a real HTML link. Then, if you set linkItem.target to "javascript", you get to respond to the clicks in formItem.click().

    Alternatively, we would recommend using a ValueFormatter to output either an actual HTML link, or a <span> around the text you want to turn into a link, where your link-mimicing style is applied only to that <span> as opposed to the entire textBox area of the FormItem.

    Comment

    Working...
    X