Created
October 20, 2011 18:15
-
-
Save julianshen/1301855 to your computer and use it in GitHub Desktop.
This file contains 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
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