You found a bug! We've classified it as TOUCH-4649 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User benwhite's Avatar
    Join Date
    Oct 2010
    Location
    Columbus, OH
    Posts
    48
    Vote Rating
    0
    benwhite is on a distinguished road

      0  

    Default [2.1.1] Clickable Input Labels

    [2.1.1] Clickable Input Labels


    Input field labels are not clickable. Why?
    I have created a simple override that will automatically set focus on the input field when it's label has been tapped.
    I'm not sure this is the best way to accomplish this, but I would like to see these enhancements added into the core Sencha Touch framework in some form or fashion.

    I have highlighted my changes from the original Ext.field.Field base code.

    Code:
    //[2.1.1]PATCH - update input labels to be clickableExt.define('MyApp.override.field.Field', {
        override : 'Ext.field.Field',
    
    
        // @private
    
        getElementConfig: function() {
            var prefix = Ext.baseCSSPrefix;
    
    
            return {
                reference: 'element',
                className: 'x-container',
                children: [
                    {
                        reference: 'label',
                        cls: prefix + 'form-label',
                        tag: 'label', //change to be label tag rather than div
                        children: [{
                            reference: 'labelspan',
                            tag: 'span'
                        }]
                    },
                    {
                        reference: 'innerElement',
                        cls: prefix + 'component-outer'
                    }
                ]
            };
        },
    
    
        // @private
        updateLabel: function(newLabel, oldLabel) {
            var renderElement = this.renderElement,
                prefix = Ext.baseCSSPrefix,
                cmp = this.getComponent(); //get component
    
    
            if (newLabel) {
                this.labelspan.setHtml(newLabel);
                renderElement.addCls(prefix + 'field-labeled');
            } else {
                renderElement.removeCls(prefix + 'field-labeled');
            }
    
            //update the label's "for" attribute now that we have a field id assigned
            this.label.dom.setAttribute('for', (cmp.input && cmp.input.id) || ''); 
    
        }
    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Vote Rating
    750
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Moved to the bugs forum to open up as a feature request.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar