1. #1
    Ext User
    Join Date
    Apr 2007
    Posts
    2
    Vote Rating
    0
    blixa is on a distinguished road

      0  

    Default TextField.hide() doesn't hide the label

    TextField.hide() doesn't hide the label


    When using .hide() on att TextField the associated label is still visible. Is it suppose to be that way or what? Feels kind of silly to have the label visible when the input field is hidden.

  2. #2
    Ext User ozilix's Avatar
    Join Date
    Mar 2007
    Location
    T
    Posts
    19
    Vote Rating
    0
    ozilix is on a distinguished road

      0  

    Default TextField hiding

    TextField hiding


    try this
    Code:
    new Ext.form.TextField({
    fieldLabel: elem[i].label,
    name: elem[i].id,
    itemCls : 'invisible'
    })

  3. #3
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    hide() on a textfield hides the textfield. That's how it should work. If you want to hide the textfield and it's label there are other ways to go about it. (One posted above)
    Jack Slocum
    Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum
    jack@extjs.com

  4. #4
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    NL
    Posts
    607
    Vote Rating
    1
    mdissel is on a distinguished road

      0  

    Default


    It is indeed strange to display the label and not the textfield

    Maybe add a parameter to the Field.hide(true) to also hide the label.. or just thinking maybe hiding the label should be default and can be change by a parameter... or add an extra field.hideLabel()


    Thanks

    Marco

  5. #5
    Ext User
    Join Date
    May 2007
    Posts
    13
    Vote Rating
    0
    cgarvey is on a distinguished road

      0  

    Default


    So if one wanted to share a form between two functions (e.g. an Add and and Edit function) what might be considered best practice for hiding one of the TextFields (and it's label) that is only applicable to one of the operations?

  6. #6
    Ext User
    Join Date
    Apr 2007
    Posts
    6
    Vote Rating
    0
    alek_mc is on a distinguished road

      0  

    Question hiding the label and :

    hiding the label and :


    the hidden true does indeed do whats its suppose to, but the job is still only one third done. I still need to hide the label and the semicolon. giving a blank label will take care of that, but its still : there. What I am really after is just the equal of <input type='hidden' .. how can I do this?

  7. #7
    Ext User
    Join Date
    Jun 2007
    Posts
    9
    Vote Rating
    0
    jerometam is on a distinguished road

      0  

    Default


    Quote Originally Posted by jack.slocum View Post
    hide() on a textfield hides the textfield. That's how it should work. If you want to hide the textfield and it's label there are other ways to go about it. (One posted above)
    Other than the method above, any other to hide all the label, semicolon and the textfield?

  8. #8
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    You could set the labelStyle:'display:none', or labelSeparator:' ' or '&nbsp;'

  9. #9
    Sencha User MD's Avatar
    Join Date
    Mar 2007
    Posts
    178
    Vote Rating
    0
    MD is on a distinguished road

      0  

    Default


    Anyone with SVN access care to add that labelStyle and labelSeparator config options to the API docs please?

  10. #10
    Ext User
    Join Date
    Oct 2008
    Posts
    2
    Vote Rating
    0
    gaudettemd is on a distinguished road

      0  

    Question Don't get it

    Don't get it


    Hi All - New to all of this. First I have to say that I love this library. I think a great job was done by all involved putting this together. After reading this I still can't get the label to appear/disappear. I agree it is kinda silly to have the label but not the form element visible. Seems to me that you should be able to directly access each Config setting within an element. Something like ext.formpanel.elementid.hiddenLabel=true this way you could easily set any config setting in a function and handle it through an event ect. Also a hideall and showall for a particular form element would be helpfull as well. It would simply hide or show everything that has a display under that elment. When I first set hide I assumed this would happen. Am I missing something? I ran around in circles for hours and hours and hours over this one. Is there a cleaner way to do it then is discribed here and also if a bit more code context could be put around the examples I would REALLY appriciate it. I'm still wet behind the ears! Many thanks in advance.

    -mike