PDA

View Full Version : Get components ScrollWidth



DrogoNevets
2 Dec 2009, 3:14 AM
Hi all
I have an issue where I have a button (actually a number, but solution will be valid for all)

that says "Home" or "Cartref" depending on the language the user selects.#

Obviously, those words are different widths but i want say 30px padding each side of the x-axis.

How can I do this?

in JavaScript (using jQuery for those wondering where the dollar signs came from) I would do



var b = $("button-x");
b.width((b.scrollWidth + 30)+"px");


That may not be exact (just done off top of my head) but you get the idea. Is there such a way to do that in GXT?

I have tried using both permutations of:

_searchButton.setStyleAttribute("padding", "0px 30px");

to no avail, open to ideas

Drogo