dbottillo
1 Jul 2010, 3:13 AM
Hi to everyone,
i'm trying to use Sencha to create a mobile web application
layout that i want to create is: a title bar up in every page, body of the page and a bottom bar
i try this:
Ext.setup({
icon: 'icon.png',
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
glossOnIcon: false,
onReady: function() {
var tabpanel = new Ext.TabPanel({
tabBar: {
dock: 'bottom',
layout: {
pack: 'center'
}
},
fullscreen: true,
ui: 'light',
animation: {
type: 'slide',
cover: true
},
defaults: {
scroll: 'vertical'
},
items: [{
title: 'Offer',
html: '<div style="width: 100%; background-color: black;color: white; font-size: 20px; padding: 5px;">Mobile widget Title</div>Offer</p>',
iconCls: 'info',
cls: 'card1'
}, {
title: 'Search',
html: '<h1>Favorites Card</h1>',
iconCls: 'search',
cls: 'card2',
addEvents : function(o){
alert("ciao");
}
}, {
title: 'Settings',
html: '<h1>Settings Card</h1>',
cls: 'card4',
iconCls: 'settings'
}, {
title: 'Refresh',
html: '<h1>Refresh</h1>',
cls: 'card4',
iconCls: 'Refresh'
}]
});
}
});
The title bar i put in the html of the first item...i have to put in every html item?
In second time, i'm trying to put an onclick event in one of the item of the toolbar...
i want that Refresh item don't put a new html in the panel...but just refresh the current panel...any hint? ( i try addEvents in the code but it fire when i load the page not when i click on the button)
i'm new with Sencha (and also Ext)
thank you
Daniele
i'm trying to use Sencha to create a mobile web application
layout that i want to create is: a title bar up in every page, body of the page and a bottom bar
i try this:
Ext.setup({
icon: 'icon.png',
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
glossOnIcon: false,
onReady: function() {
var tabpanel = new Ext.TabPanel({
tabBar: {
dock: 'bottom',
layout: {
pack: 'center'
}
},
fullscreen: true,
ui: 'light',
animation: {
type: 'slide',
cover: true
},
defaults: {
scroll: 'vertical'
},
items: [{
title: 'Offer',
html: '<div style="width: 100%; background-color: black;color: white; font-size: 20px; padding: 5px;">Mobile widget Title</div>Offer</p>',
iconCls: 'info',
cls: 'card1'
}, {
title: 'Search',
html: '<h1>Favorites Card</h1>',
iconCls: 'search',
cls: 'card2',
addEvents : function(o){
alert("ciao");
}
}, {
title: 'Settings',
html: '<h1>Settings Card</h1>',
cls: 'card4',
iconCls: 'settings'
}, {
title: 'Refresh',
html: '<h1>Refresh</h1>',
cls: 'card4',
iconCls: 'Refresh'
}]
});
}
});
The title bar i put in the html of the first item...i have to put in every html item?
In second time, i'm trying to put an onclick event in one of the item of the toolbar...
i want that Refresh item don't put a new html in the panel...but just refresh the current panel...any hint? ( i try addEvents in the code but it fire when i load the page not when i click on the button)
i'm new with Sencha (and also Ext)
thank you
Daniele