1. #1
    Sencha User
    Join Date
    Mar 2007
    Posts
    22
    Vote Rating
    0
    rbudisa is on a distinguished road

      0  

    Default Clickable Form Textfiled Label

    Clickable Form Textfiled Label


    I have a form in a 2 column layout with 12 fields and I'd like to be able to fire / handle a field specific event when a user clicks. Is there a way to convert the field label into a text hyperlink? Should I use an action here next to the label? a button? Users prefer this to be next to the textfields rather than in the toolbar.
    Any suggestions welcome.

    Thanks,
    Ron

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    Add a click handler to the Panel's body Element.

    In the handler, check that the event is fired from a label:

    Code:
    labelClickHandler: function(e) {
        var t = e.getTarget('label');
        if (t) {
    //      Access the form Field.
            var f = Ext.getCmp(t.for);
        }
    },
    See http://extjs.com/deploy/dev/docs/?cl...mber=getTarget

    You can add :hover rules to your stylesheet to give the labels some kind of indication that they are live (In modern browsers... and they are certainly what we target, they are free to download).

    http://www.w3.org/TR/CSS21/selector....pseudo-classes

Thread Participants: 1