Skip to content

Instantly share code, notes, and snippets.

@ozero
Created July 13, 2012 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozero/3104685 to your computer and use it in GitHub Desktop.
Save ozero/3104685 to your computer and use it in GitHub Desktop.
sencha touch 2 tabpanel load external html
// You should use Ext.application, not Ext.setup
Ext.application({
name: 'SampleLoad',
requires: ['Ext.Ajax'],
launch: function () {
Ext.create("Ext.tab.Panel", {
fullscreen: true,
tabBarPosition: 'bottom',
items: [
{
id: 'welcome-tab',
title: 'Home',
iconCls: 'home',
// dummy text: to be overwritten with external html
html: 'Welcome'
},
{
id: 'sample-tab',
title: 'aaaa',
iconCls: 'reply',
// dummy text: to be overwritten with external html
html: 'aaaaaaaa'
}
]
});
Ext.Ajax.request({
url: 'sample.html', // place into same dir with app.js
method: 'GET',
callback: function(options, success, response) {
Ext.ComponentQuery.query('#sample-tab')[0].setHtml( response.responseText );
}
});
Ext.Ajax.request({
url: 'welcome.html', // place into same dir with app.js
method: 'GET',
callback: function(options, success, response) {
Ext.ComponentQuery.query('#welcome-tab')[0].setHtml( response.responseText );
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment