Results 1 to 3 of 3

Thread: Center ContentPanel Header Text

  1. #1
    Ext User
    Join Date
    Dec 2007
    Posts
    9
    Vote Rating
    0
      0  

    Default Center ContentPanel Header Text

    I would like to center the header text of ContentPanel. If I create a css class and add to the header object, it works:

    Code:
    / / MyCss.css
    .centerTextAlign (
     text-align: center;
    )
    
    ContentPanel gridContainer = new ContentPanel();
    gridContainer.getHeader().addStyleName("centerTextAlign");
    But why this:
    Code:
    gridContainer.getHeader().setStyleAttribute("text-align", "center");
    or this:
    Code:
    gridContainer.getHeader().getElement().getStyle().setProperty("text-align", "center");
    does not work?

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

    Default

    You need to set it this way:

    Code:
    getHeader().setStyleAttribute("textAlign", "center");

  3. #3
    Ext User
    Join Date
    Dec 2007
    Posts
    9
    Vote Rating
    0
      0  

    Default

    Thank you!

Posting Permissions

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