I'm working on a web application in GXT.
I need a way to determine, at runtime if the text from a label is too large and show something like: click to view all text (shorter text maybe).
Then all the text will be shown in a pop-up.
I don't know how I can tell that the text will not fit. Should I approximate by the number of letters, let's say my container is 400px in width, and I have a 50 letter text, i can assign a medium width per letter, like 7px / letter?
Do you have any suggestions? Maybe there's already a component that does this.
Thanks.
EDIT:
In one part of the app, my labels are in a FlexTable. I was thinking of going through the FlexTable cells and get the height of every cell, and if the height is more than one normal line height (20px?), trim the label.
Question is: how to I get the height of a FlexTable cell? Or the height of a FlexTable row?