html - Explore style element in GWT client code -
I have a GWT code that creates a list (as a result grid) and I have a style like a CSS class
Now ... if the code requires me to get "26px" when the render is not complete or when there is no element in the grid? Can I get that value? I know I can How to get some style attributes, but how can I get sub-element tr related values? .test tr {height: 26px; }
obj.getElement (). GetStyle () GetProperty ("height");
To do this, you need to get the 'calculated' style of the element. This is some expensive operation, so should be done carefully, and will not work in earlier versions of IE, so A completely different code should be written. Some libraries like GSTT have a built-in feature for you to do this ( XElement.getComputedStyle (...)
), if you are not using a library like this, then you write JSNI Who can call this API and ask for these details.
Check (Use IE8 and not below, old Android browser and Opera Mini have a problem), and for details of call in your JSN, using $ wnd
Refer to the window
object for something like this:
$ wnd.getComputedStyle (element) .getPropertyValue ('height');
Comments
Post a Comment