Results 1 to 4 of 4

Thread: Checkbox align in grid

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    8

    Default Checkbox align in grid

    Hi,
    I'm trying to place a checkbox-column into a grid. Everything works fine, but I can't place the checkboxes in the center of the column. Below is the code.

    Code:
    ColumnConfig<MockData, Boolean> column0 = new ColumnConfig<MockData, Boolean>(props.col0(), 100, "column0");
      ColumnConfig<MockData, String>  column1 = new ColumnConfig<MockData, String> (props.col1(), 100, "column1");
      @SuppressWarnings("serial")
      ColumnConfig<MockData, Double>  column2 = new ColumnConfig<MockData, Double> (props.col2(), 100, new SafeHtml() {
       public String asString() {
        return "column2<br/>column2b";
       }
      });
      ColumnConfig<MockData, String>  column3 = new ColumnConfig<MockData, String> (props.col3(), 100, "column3");
      ColumnConfig<MockData, String>  column4 = new ColumnConfig<MockData, String> (props.col4(), 170, "column4");
      
      column0.setCell(new CheckBoxCell());
      column0.setMenuDisabled(true);
      column0.setAlignment(HasHorizontalAlignment.ALIGN_CENTER); // has no effect
      column2.setAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
      column3.setAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
      column4.setAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
      
      List<ColumnConfig<MockData, ?>> columnConfigList = new ArrayList<ColumnConfig<MockData, ?>>();
    ...
    Any Ideas?

    Thanks in advance

    Selcuk

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    413
    Answers
    20

    Default

    I don't know if this will work, but in the cell grid example: http://sencha.com/examples-dev/#ExamplePlace:cellgrid, take a look at the source code and look for what they're doing w/r/t SafeStyles.

    Try using the string "text-align: center;" and see what this does. You can verify using Firebug as to whether or not this style is indeed set on the cell (whether or not it actually works.)

    HTH,

    --adam

  3. #3
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    8

    Default

    Quote Originally Posted by icfantv View Post
    I don't know if this will work, but in the cell grid example: http://sencha.com/examples-dev/#ExamplePlace:cellgrid, take a look at the source code and look for what they're doing w/r/t SafeStyles.

    Try using the string "text-align: center;" and see what this does. You can verify using Firebug as to whether or not this style is indeed set on the cell (whether or not it actually works.)

    HTH,

    --adam
    Hi,

    thanks, I will try it

    Bye

    Selcuk

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2012
    Location
    Italy
    Posts
    13

    Default

    I actually have the same problem. I tried the proposed solution but it didn't work. Any other ideas?

    Edit - check out this workaround: http://www.sencha.com/forum/showthre...grid&p=1038794

Posting Permissions

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