1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    6
    Vote Rating
    0
    nick_laros is on a distinguished road

      0  

    Default Error loading new content to panel

    Error loading new content to panel


    I have a panel that load some html content, here's the code:
    Code:
    Ext.define('PMK.view.panel.Personalization' ,{
        extend: 'Ext.panel.Panel',
        alias : 'widget.userpersonalization',
        
        autoScroll: true,
        border: false,
        
        initComponent: function() {
            this.autoLoad = ({ url:'page/htmlbio.php', text: 'Loading User Biodata...' });
    
            this.callParent(arguments);
        }
    });
    the autoLoad is working, and then I try to load the panel with newly updated html.
    Code:
    Ext.ComponentQuery.query('userpersonalization').load({
            url:  'page/htmlbio.php',
            scripts: true
    });
    the Ext.ComponentQuery.query('userpersonalization') successfully return the component but I got this error
    Ext.ComponentQuery.query("userpersonalization").load is not a function

    so, can someone explain how to load new content to panel?

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,054
    Vote Rating
    659
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    query() returns an array, you need the object reference.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Posts
    6
    Vote Rating
    0
    nick_laros is on a distinguished road

      0  

    Default


    thx for the reply, after I add an id config to panel then I use this to reference the object.. it's working

    Code:
            Ext.getCmp('mypanel').getLoader().load({
                    url:  'page/htmlbio.php',
                    scripts: true
            });

  4. #4
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    So you are working with ComponentLoader, then should work panel.getLoader().load()

  5. #5
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    :16, :17 almost

Thread Participants: 2

Tags for this Thread