Results 1 to 4 of 4

Thread: Text Field - Aligning text with right alignment for a number type content

  1. #1
    Sencha User
    Join Date
    Nov 2008
    Posts
    23
    Vote Rating
    0
      0  

    Default Unanswered: Text Field - Aligning text with right alignment for a number type content

    I would like to do the same thing in GXT as the per the ExtJS instructions

    http://www.sencha.com/forum/showthre...d-to-the-right

    TextField<String> field = new TextField<String>();

    field.setStyleAttribute("text-align", "right");

    But it does not work. Please help.

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Answers
    60
    Vote Rating
    132
      0  

    Default

    Take a look at the output with Firebug. You will see that you assign the text align to the wrong element. You need to assign it to the input element. You are assigning it to the wrapping div.

  3. #3
    Sencha User
    Join Date
    Nov 2008
    Posts
    23
    Vote Rating
    0
      0  

    Default

    Sven,

    Thanks for the reply.

    I am able to make the field right aligned by using this code.

    Code:
    field.el().getChild(0).setStyleAttribute("text-align", "right");
    I am wondering if this is the right way to access the input element. I am setting each field with an unique ID. Can I access the input element using the ID of the input element with "ID-input"?. What piece of code I should use?

    Thanks

  4. #4
    Sencha User
    Join Date
    Jun 2008
    Posts
    8
    Vote Rating
    0
      0  

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •