1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    18
    Vote Rating
    1
    sraghura201 is on a distinguished road

      0  

    Default What do I use instead of autoLoad for Ext.Window.window

    What do I use instead of autoLoad for Ext.Window.window


    I noticed that autoLoad is not longer a supported config option for Ext.window. I have seen threads recommending the use of ComponentLoader. After some digging around, I think you use a loader: config instead of autoLoad

    Code with autoLoad
    Code:
     new  Ext.Window({.....
        layout: 'border',
        items: [{
          region: 'center',
          layout: 'fit',
          frame: false,
          border: false,
          autoLoad: {
          url: 'url',
          scripts:false,
          discardUrl: true,
          callback: myCallback,
          timeout: 15
          } 
    }
    ...]});
    My url returns HTML content which I want loaded into the center region of my border layout window.
    the myCallback function assumes that the HTML content from the url is available and acts on it.

    Code with loader
    Code:
     new  Ext.Window({.....
        layout: 'border',
        items: [{
          region: 'center',
          layout: 'fit',
          frame: false,
          border: false,
          loader: {
          url: 'url',
          scripts:false,
          discardUrl: true,
    callback:myCallback,
          timeout: 15
          }
    }
    ...]});
    This does not work since the center HTML is never loaded. Should myCallback be a callback or a renderer? How do I get the HTML to show up in the center region? I tried target:this which didn't work either. I am sure it's a pretty simple config option but I cannot figure it out.

    Thanks

  2. #2
    Sencha User crysfel's Avatar
    Join Date
    Feb 2008
    Location
    New York, USA
    Posts
    218
    Vote Rating
    8
    crysfel will become famous soon enough

      0  

    Default


    add the "autoLoad" config to the loader:

    Code:
    loader	: {
    			autoLoad	: true,
    			url		: "url/to/your/file",
    			scripts	: false
    		}
    Best regards

  3. #3
    Sencha User
    Join Date
    Jul 2011
    Posts
    18
    Vote Rating
    1
    sraghura201 is on a distinguished road

      0  

    Default


    Thanks that seemed to do the trick.

Thread Participants: 1