GXT NumberField / TextField align right

Is there a clean way to align the digits of a NumberField to the right?

I found this post which suggests an answer in GXT 2 :

this .setInputStyleAttribute("text-align", "right");

But it does not work in GXT 3 and I did not find any equivalent.


I finally did it with some CSS.

After looking at the generated HTML of a NumberField, it was something like

<div>
  <div>
    <input type="text" ...>
  </div>
</div>

So, I finally defined this css property

.numberField input{
  text-align : right;
}

and applied it on all my NumberFields.


尝试textField.setDirection(Direction.RTL);

链接地址: http://www.djcxy.com/p/64406.html

上一篇: gxt将图像与组合框对齐

下一篇: GXT NumberField / TextField右对齐