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

.test tr {height: 26px; }

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

  obj.getElement (). GetStyle () GetProperty ("height");  

How to get some style attributes, but how can I get sub-element tr related values?

style property, - It does not automatically pick up CSS that it has been applied to, or CSS has been applied to parent nodes and it has been inherited, etc.

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

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -