/ Published in: JavaScript
Sometimes you have a load of HTML that is difficult to write up as a String from within a javascript function so this is an example of a simple Panel with an event for after rendering that injects it with content from a file.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
whereMainPanel = new Ext.Panel({ layout:{align:'stretch'}, cls:'whereMainPanel' }); whereMainPanel.on('afterrender',function() { Ext.Ajax.request({ url: 'assets/animation/WhereAnimProj/WhereAnimProj_export/index.html', success: function(response, opts) { whereMainPanel.update(response.responseText); } }) this.body.on('click',function(){ menuPanel.setActiveItem(1); backBtn.setVisible(true); }) })