Results 1 to 3 of 3

Thread: Alignment of checkbox relative to label

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2014
    Posts
    71
    Answers
    3

    Default Alignment of checkbox relative to label

    I know this seems trivial but is there any way to achieve the equivalent of "vertical-align:top;" with a checkbox relative to its label if the label wraps? See the attached screenshot to know what I'm talking about. I have tried everything.

    I'm using 6.2.1 Modern Toolkit with the material theme. In this example I have the labelAlign property set to "right" and the labelWidth property set to 100% so that the checkbox is "pushed" over to the left edge of the form. I just want to get the checkbox aligned at the top of the wrapped label. Any help is greatly appreciated.
    Attached Images Attached Images

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    I played around with this but I couldn't achieve the same effect as you have pictured. In any case, I found some CSS settings that might help depending on your layout.
    https://fiddle.sencha.com/#view/editor&fiddle/1n1a

  3. #3
    Sencha Premium Member
    Join Date
    Jun 2014
    Posts
    71
    Answers
    3

    Default

    Thanks for giving it a try but I found that your solution only works for a certain vertical height of the label. So in other words, depending on how many times the label wraps the checkbox may or may not end up at the top.

    After spending way too much time on this I have concluded that it is just not possible to achieve this, which is strange because IMHO it looks kind of strange to have the checkbox in the middle vertically. The only way I think I'll be able to get what I want is to create my own hbox container with a checkbox field (no label) and a second component with HTML for the label so I can align them the way I want. Didn't really want to go that route...

Similar Threads

  1. Checkbox Label Alignment To Left
    By informer1985 in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 25 Apr 2011, 2:56 AM
  2. CheckBox label alignment
    By dbassett74 in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 24 Sep 2009, 12:31 PM
  3. [GXT 2,0 Trunk/FF 2/Linux] Checkbox label alignment
    By jbaxter in forum Ext GWT: Bugs (2.x)
    Replies: 0
    Last Post: 8 Jun 2009, 11:46 AM
  4. Need help with label alignment
    By nugatto in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 31 Oct 2008, 12:39 AM
  5. AlignLayout manages alignment and offsets relative to its Container
    By dnalot in forum Ext 2.x: User Extensions and Plugins
    Replies: 12
    Last Post: 21 Apr 2008, 9:24 AM

Posting Permissions

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