1. #1
    Ext User
    Join Date
    Mar 2010
    Posts
    25
    Vote Rating
    0
    tr888 is on a distinguished road

      0  

    Default css selector for the label associated with a particular checkbox?

    css selector for the label associated with a particular checkbox?


    Checkbox and their labels are being rendered by Ext Designer not with the nested label syntax but with the "for={id}" syntax, like this:
    Code:
    <div id="ext-gen###" ... >
    <input id = "foo" ... >
    <label id = "ext-gen###" ... for="foo">foo label</label>
    </div>
    The DIV wrapper and label receive autogenerated ids. The checkbox input field has the id that I have assigned.
    What is the CSS selector for the label associated with the checkbox whose id = "foo"? I don't want to reference the label by class x-form-cb-label.
    Thanks

  2. #2
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough

      0  

    Default


    CSS3 Solution, which is not cross-browser compatible:

    Code:
    input#foo + label
    Consider using an Ext.Element to get to the label programmatically, and perhaps applying your own CSS class or styles to the label element that way:

    Code:
    Ext.fly('foo').next().addClass('myCustomLabelClass');
    See the documentation on Ext.Element:
    http://www.extjs.com/deploy/dev/docs/?class=Ext.Element

Thread Participants: 1