Results 1 to 5 of 5

Thread: Problem with update 4.0.2a to 4.0.7

  1. #1
    Sencha User
    Join Date
    Jul 2011
    Location
    Marseille, France
    Posts
    19
    Vote Rating
    0
      0  

    Default Problem with update 4.0.2a to 4.0.7

    Hi, the new version doesn't works with this code:
    Code:
            var cbYearCombo01_01 = document.getElementById('annee_01_01');
            for (i = CurrentYear; i > 2002; --i) {
                var item = document.createElement("option");
                item.text = i; item.value = i;
                cbYearCombo01_01.options.add(item);
            }
    Chrome responds:
    Code:
    Uncaught TypeError: Cannot read property 'options' of null
    
    And Firebug:
    Code:
    cbYearCombo01_01 is null

    This code worked fine with 4.0.2a version, how can I modify this function to add dynamicaly items to html combo?

    Thanks!

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,382
    Answers
    3997
    Vote Rating
    1536
      0  

    Default

    You're not doing anything Ext there it looks like.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jul 2011
    Location
    Marseille, France
    Posts
    19
    Vote Rating
    0
      0  

    Default

    In fact "annee_01_01" is an HTML combo included in Ext TabPanel.

    This component is rendered when TabPanel_01 is activate. With 4.0.2a version of Ext, I should activate TabPanel like this:
    HTML Code:
    Ext.getCmp('TABpanel_01').setActiveTab(0);
    and HTML combo is accessible (with getElementById).

    With 4.0.7 version, it seems HTML component is not rendered even if TabPanel is activated (by the code), and getElementById returns null value.

    What is certain is that with the old version that's works like a charm.


    Any idea?

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,382
    Answers
    3997
    Vote Rating
    1536
      0  

    Default

    We only render one tab at a time. When you click on a tab, it's contents are rendered.

    http://docs.sencha.com/ext-js/4-0/#!...deferredRender
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  5. #5
    Sencha User
    Join Date
    Jul 2011
    Location
    Marseille, France
    Posts
    19
    Vote Rating
    0
      0  

    Red face

    deferredRender to false don't solve my problem

    To understand better there is a code:

    Main window with TabPanel:
    Code:
    (function() {
        Ext.define('windowUI', {
            extend: 'Ext.window.Window',
            width: 920,
            height: 600,
            defaults: {
                collapsible: true,
                split: true,
                animFloat: false,
                autoHide: false,
                useSplitTips: true
            },
            initComponent: function() {
                this.items = [
                {
                    xtype: 'panel',
                    layout: 'accordion',
                    activeItem: 0,
                    height: 540,
                    items: [
                    {
                        xtype:'tabpanel',
                        id: 'TABpanel_01',
                        defaults    : {border:false, activeTab:0, height: 410, border:false, autoScroll: true},
                        items:[
                          {
                            ,id   : 'Panel_01_Tab_01'
                          }
                        ,
                          {
                            ,id   : 'Panel_01_Tab_02'
                          }
                        ]
                    }]
                }]
                ,windowUI.superclass.initComponent.call(this);
            }
        })
    })();
    Add combo items script:
    Code:
            Ext.getCmp('TABpanel_01').setActiveTab(0);
            var cbYearCombo01_01 = document.getElementById('annee_Panel_01_Tab_01');
            for (i = CurrentYear; i > 2002; --i) {
                var item = document.createElement('option');
                item.text = i; item.value = i;
                cbYearCombo01_01.options.add(item);
            }
    
            Ext.getCmp('TABpanel_01').setActiveTab(1);
            var cbYearCombo01_02 = document.getElementById('annee_Panel_01_Tab_02');
            for (i = CurrentYear; i > 2002; --i) {
                var item = document.createElement("option");
                item.text = i; item.value = i;
                cbYearCombo01_02.options.add(item);
            }

Posting Permissions

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