PDA

View Full Version : How do I load HTML into my Panel?



jacksco
21 Sep 2011, 3:35 AM
I am having trouble loading external HTML into my view. All I wish to do is pass <p>text<p> from my content.html file into my the panel below but nothing seems to work. I've tried Ajax with Ext.Ajax and Jquery but no luck :(

Could anyone give me any feedback on how to get this to work. There are may posts similar to this but none have worked so far.


App.views.HomeIndex = Ext.extend(Ext.Panel, {
html: data,
script: true,
scroll: 'vertical',
styleHtmlContent: true,
style: 'background: #333'

});


Much appreciated,
Jack

milo08
21 Sep 2011, 4:51 AM
Hi Jack,

first of all create your Panel and then make a Ajax Request to your local content.html file.
Finally update the panel with your html.



var yourPanel = new Ext.Panel({

scroll: 'vertical',
styleHtmlContent: true,
style: 'background: #333',
html: ''
});


Ext.Ajax.request({
url: 'resources/html/content.html',
method: 'GET',
callback: function(options, success, response) {
yourPanel.update(response.responseText);
}
});



greetz milo