PDA

View Full Version : Component loader use question



slemmon
9 Apr 2012, 11:25 AM
I wanted to check in and see if I'm using the component loader's load method correctly.
I have a panel with a loader defined like so:



region: 'center'
, itemId: 'documentationContent'
, autoScroll: true
, loader: {
url: 'placeholder.html'
, loadMask: true
}


I want to then supply a different doc to the loader's url. I'm doing that like so:



panel.getLoader().load({
url: 'something_completely_different.html'
, loadMask: true
})


The url that is employed in the load is the original placeholder doc and not the one specified in the load's options object.

I assume I'm skipping a step somewhere. Thoughts?

I'm using RC2 for 4.1 if that helps.

vietits
9 Apr 2012, 5:18 PM
FYI: The following code works well on Chrome 18, both Ext 4.0.7 & Ext 4.1.0-rc2


Ext.onReady(function(){
var panel = Ext.create('Ext.panel.Panel', {
renderTo: Ext.getBody(),
height : 200,
width : 200,
loader : {
autoLoad: true,
url: 'test1.html',
loadMask: true
},
buttons : [{
text: 'change doc',
handler: function(){
panel.getLoader().load({
url: 'test2.html',
loadMask: true
});
}
}]
});
});

slemmon
11 Apr 2012, 8:44 AM
That works. Turns out I was doing something wrong when querying my tree nodeInterface record object to get the path to load the document - really nothing to do with the loader at all as it turns out. :">

Thx for the reply. I'll mark this one answered.