Results 1 to 4 of 4

Thread: extend constructor config object

  1. #1

    Default extend constructor config object

    Hi guys, i'm trying to extend a class but i need to update the items via the config object passed to the constructor. The code below is not working. Does anybody knows where i can find documentation about the config passed to the constructor (i looked everywhere) or if there is a better way to do this (change the items in the extended class ):

    tks.

    Code:
    Ext.ux.RVMenuPanelGroup = Ext.extend(Ext.tree.TreePanel,
    {
        constructor: function(config)
        {
            // config.rootVisible = false;
            Ext.apply(this, 
            {
                rootVisible:    false,
                border:            false,
                lines:            false,
                root:            new Ext.tree.AsyncTreeNode(
                                {
                                    draggable:    false
                                 })
            });
            
            config = config || {};
    //        if (Ext.isArray(config))
    //        {
    //            config = {items:config};
    //        }
    
            console.log('config ', config.items.length);
            
            // this will not work
            config.items.each(function(item, index, length)
            {
    
            });
            
            Ext.ux.RVMenuPanelGroup.superclass.initComponent.apply(this, arguments);
        }
    });
    
    Ext.reg('RVMenuPanelGroup', Ext.ux.RVMenuPanelGroup);

  2. #2

  3. #3

    Default

    he, he... tks for the quick answer, and sorry about the code and yes, i read all the tutorias about class extend.

    tks.

  4. #4

    Default

    ok.

    Code:
            for (var x=0; x<config.items.length; x++)
            {
                config.items[x].leaf = true;
            }
    works.

    tks.

Posting Permissions

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