Skip to content

Instantly share code, notes, and snippets.

@julianshen
Created October 20, 2011 18:15
Show Gist options
  • Save julianshen/1301855 to your computer and use it in GitHub Desktop.
Save julianshen/1301855 to your computer and use it in GitHub Desktop.
Ext.application({
name: 'tabtest1',
launch: function() {
var tabItems = [];
var pages = Ext.query('div[data-role=page]');
var main = pages[0]; //take first page as main page
var tabs = Ext.query('div[data-role=tab]', main);
Ext.each(tabs, function(tab, index) {
var item = {
title: tab.getAttribute('data-title'),
iconCls: tab.getAttribute('data-icon'),
html: tab.innerHTML
};
tabItems.push(item);
});
//Remove page from body
document.body.removeChild(main);
Ext.create("Ext.TabPanel", {
fullscreen: true,
tabBar: {
docked: 'bottom',
layout: {
pack: 'center'
}
},
defaults: {
styleHtmlContent: true,
scrollable: true
},
items: tabItems
});
console.log('ok');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment