Results 1 to 3 of 3

Thread: Modern 6.7 Disable prevents TabIndex from being set

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Touch Premium Member
    Join Date
    Sep 2011
    Posts
    99

    Default Modern 6.7 Disable prevents TabIndex from being set

    Modern 6.7. If you set both disable: true and tabIndex to any value, tabIndex with be 0.
    This is a problem because the developer may have a field that should start out disabled, but then be enabled later.
    The workaround is, of course, to set tabIndex in initialize.

    For an example, see https://fiddle.sencha.com/#view/editor&fiddle/2ser

    Code:
    Ext.application({    name : 'Fiddle',
    
    
        launch : function() {
            var textfield, textfield2;
            Ext.create('Ext.form.Panel', {
                fullscreen: true,
                items: [{
                    xtype: 'button',
                    text: 'Enable',
                    handler: function() {
                        //textfield.setDisabled(false);
                        Ext.Msg.alert('Disabled/TabIndex bug',
                        'Both textfields below have tabIndex = 42, but the first one is disabled' +
                        ' and so the tabIndex is 0.  ' + 'First textfield tabIndex should be 42, not ' + textfield.getTabIndex());
                    }
    
    
                }, {
                    xtype: 'textfield',
                    label: 'A textfield',
                    disabled: true,
                    tabIndex: 42,
                    listeners: {
                        initialize: function(ctl) {
                            textfield = ctl;
                        }
                    }
                }, {
                    xtype: 'textfield',
                    label: 'Another textfield',
                    disabled: false,
                    tabIndex: 42,
                    listeners: {
                        initialize: function(ctl) {
                            textfield2 = ctl;
                        }
                    }
                }]
            })
        }
    });

  2. #2
    Touch Premium Member
    Join Date
    Sep 2011
    Posts
    99

    Default

    Filed a support request on this #47742

  3. #3
    Touch Premium Member
    Join Date
    Sep 2011
    Posts
    99

    Default

    The only workaround we could find was to set tabindex in the configuration and disabled it in the initialize event. BTW, doing it in the opposite order does not work. The problem seems to be that tabindex is set in Ext.mixin.Focusable and disabled is set in Ext.Widget - and the two don't coordinate.

    BTW, this is Issue: EXTJS-28344.

Tags for this Thread

Posting Permissions

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