PDA

View Full Version : How to combine two moduls?



breytex
13 Feb 2011, 1:33 PM
Hello there!

I am new in using sencha Touch-Framework, and i am very excited about it..
Really brilliant stuff, thank you so far.

I was wondering, how i can combine two modules...

For example:

I want to have a bottom-toolbar with buttons in every tab-view.
So i need to add a command, creating a toolbar in the "demos/tabs.js", right?
(better: i want to combine the functions of "demos/tabs.js" and "demos/buttons.js".)
But i dont really get it done...

Can someone give me a hint?

Second Question:
How can i center the tabs created with "demos/tabs.js" ?
Its a little ugly, that the tabs are left-binded...


Thanks in advance. :-)

breytex
14 Feb 2011, 9:36 AM
nobody can help me?

MikeMcB
14 Feb 2011, 10:28 AM
You are going to combine multiple elements on one panel. Check out this screen cast on views to see how its done. http://vimeo.com/15672257

A tip for centering items, use the flex views and create 2 empty items, and sandwich the item between them.

breytex
17 Feb 2011, 7:38 AM
Hi,
i can not really find a answer to my question in your linked video :-/
The Video shows pritty basic skills, i already know.

Can you give me an other hint?

Thanks!
'-breytex

MagoPagliaccio
17 Feb 2011, 7:43 AM
Second Question:
How can i center the tabs created with "demos/tabs.js" ?
Its a little ugly, that the tabs are left-binded...


Thanks in advance. :-)

To center the tabs on the bar, you just need to add this code



tabBar: {
layout: {
pack: 'center'
}
},


so the tabs example becomes




Ext.setup({
icon: 'icon.png',
glossOnIcon: false,
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
onReady: function() {
new Ext.TabPanel({
fullscreen: true,
type: 'dark',
sortable: true,
tabBar: {
layout: {
pack: 'center'
}
},
items: [{
title: 'Tab 1',
html: '1',
cls: 'card1'
}, {
title: 'Tab 2',
html: '2',
cls: 'card2'
}, {
title: 'Tab 3',
html: '3',
cls: 'card3'
}]
});
}
});



MP

breytex
17 Feb 2011, 8:27 AM
Thanks!
It works :)

But my first question is more important..

I want, for example, combine the Tabmenu, and the Bottom-icon-menu.

Is there any possibility to set up both menus to the same time?
The result should be a page, with a Top-Tab-Menu, and a Bottom-Icon-Menu..


As far as i understand the class, its not easy to do this, because both menus (tabbed and icons) are an instance of the "tabpanel" and share the array "items"...

Someone got a hint?

Thanks! :D

breytex
23 Feb 2011, 3:55 AM
no help there :( ?