Results 1 to 3 of 3

Thread: Pass arguments to Extended Panel

  1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    11

    Default Pass arguments to Extended Panel

    Hi,

    Maybe my english level isn't high enough, I do not understand completely mjlecomte 's tutorial.

    I have an extended panel :
    MyDesktop.Article.OngletArti= Ext.extend(Ext.Panel,{
    ...
    })
    I use it in a TabPanel, but I would like to pass some values when I make my :

    MyTabPannel.add(new MyDesktop.Article.OngletArti(value))

    I have tried this :

    Code:
     MyDesktop.Article.OngletArti= Ext.extend(Ext.Panel,{
                title: 'Fiche article',
                layout:'border',
                closable:true,  
                initComponent: function(MyValue) { 
                  ...
                  ... triing to use MyValue
                  ...
                  MyDesktop.Article.OngletArti.superclass.initComponent.call(this);
                }
    })
    When I try to call the constructor with new MyDesktop.Article.OngletArti('myvalue) I get a :

    Code:
    this.el is null
    [IMG]chrome://firebug/content/blank.gif[/IMG]Ext.Component=function(B){B=B||{};if(B.i...)}});Ext.reg("component",Ext.Component);
    Does anybody have an idea ?

    Thanks

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256

    Default

    Code:
    MyTabPannel.add(new MyDesktop.Article.OngletArti({myValue: 'foo'}));
    
     MyDesktop.Article.OngletArti= Ext.extend(Ext.Panel,{
                title: 'Fiche article',
                layout:'border',
                closable:true,  
                initComponent: function() { 
                      alert(this.myValue);
                  MyDesktop.Article.OngletArti.superclass.initComponent.call(this);
                }
    })
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Ext User
    Join Date
    Jun 2008
    Posts
    11

    Default

    Thanks a LOT !

Posting Permissions

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