Created
July 13, 2012 12:42
-
-
Save ozero/3104685 to your computer and use it in GitHub Desktop.
sencha touch 2 tabpanel load external html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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