Results 1 to 5 of 5

Thread: Error loading new content to panel

  1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    6
    Vote Rating
    0
      0  

    Default 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
    18,434
    Vote Rating
    859
      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
      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
    Cluj, Romania
    Posts
    687
    Vote Rating
    50
      0  

    Default

    So you are working with ComponentLoader, then should work panel.getLoader().load()
    Github https://github.com/vadimpopa
    Sencha tips and articles : http://vadimpopa.com
    Twitter: @vadimvpopa

  5. #5
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    687
    Vote Rating
    50
      0  

    Default

    :16, :17 almost
    Github https://github.com/vadimpopa
    Sencha tips and articles : http://vadimpopa.com
    Twitter: @vadimvpopa

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
  •