bamato
29 Dec 2010, 3:18 AM
Hello everybody,
We use Sencha Touch for a schoolproject and we made the core layout, though we have one problem.
We made a TabPanel and one tab refers to 'form1', which is a FormPanel (named 'form1'). When we click on the tap which refers to the formpanel, the formpanel is displayed too big. We tried everything, like adding listeners and doLayout();
Please look at the code and if you can find the problem, we would be eternally gratefull!
A live demo is hosted on http://www.sitescripting.nl/pfws/. Please watch this demo on your iPhone, since we are testing on that platform.
Thanks in advance for all help!
Ext.setup({
icon: 'icon.png',
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
glossOnIcon: false,
onReady: function() {
Ext.regModel('Les', {
fields: ['id', 'naam', 'docent', 'lokaal', 'dag', 'uur'],
proxy: {
type: 'localstorage',
id : 'Lessen'
}
});
var form1 = new Ext.form.FormPanel({
scroll: 'vertical',
standardSubmit : false,
items: [
{
xtype: 'textfield',
name : 'les1',
label: 'Les 1',
useClearIcon: true,
autoCapitalize : true
}, {
xtype: 'textfield',
name : 'docent1',
label: 'Docent',
useClearIcon: true,
autoCapitalize: true
}, {
xtype: 'textfield',
name : 'lokaal1',
label: 'Lokaal',
useClearIcon: true
}]
});
var paneel = new Ext.TabPanel({
tabBar: {
dock: 'bottom',
layout: {
pack: 'center'
}
},
activeTab: 0,
fullscreen: true,
layoutOnTabChange: true,
ui: 'light',
cardSwitchAnimation: {
type: 'fade',
cover: true
},
defaults: {
scroll: 'vertical'
},
items: [{
title: 'Overzicht',
html: '<h1>iClassroom</h1><p>Welkom op de testpagina van iClassroom.</p>',
iconCls: 'home',
cls: 'card1'
}, {
xtype: 'container',
title: 'Lessen',
iconCls: 'rooster-icon',
icon: '../themes/images/default/pictos/calendar2.png',
items: form1,
layout: 'vbox',
cls: 'card2',
badgeText: '7',
anchor: '20%'
}, {
title: 'Huiswerk',
html: '<h1>Huiswerk</h1>',
cls: 'card3',
iconCls: 'bookmarks'
}, {
title: 'Projecten',
html: '<h1>Projecten</h1>',
cls: 'card4',
iconCls: 'team',
badgeText: '3'
}, {
title: 'Instellingen',
cls: 'card5',
iconCls: 'settings'
}],
});
}
});
We use Sencha Touch for a schoolproject and we made the core layout, though we have one problem.
We made a TabPanel and one tab refers to 'form1', which is a FormPanel (named 'form1'). When we click on the tap which refers to the formpanel, the formpanel is displayed too big. We tried everything, like adding listeners and doLayout();
Please look at the code and if you can find the problem, we would be eternally gratefull!
A live demo is hosted on http://www.sitescripting.nl/pfws/. Please watch this demo on your iPhone, since we are testing on that platform.
Thanks in advance for all help!
Ext.setup({
icon: 'icon.png',
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
glossOnIcon: false,
onReady: function() {
Ext.regModel('Les', {
fields: ['id', 'naam', 'docent', 'lokaal', 'dag', 'uur'],
proxy: {
type: 'localstorage',
id : 'Lessen'
}
});
var form1 = new Ext.form.FormPanel({
scroll: 'vertical',
standardSubmit : false,
items: [
{
xtype: 'textfield',
name : 'les1',
label: 'Les 1',
useClearIcon: true,
autoCapitalize : true
}, {
xtype: 'textfield',
name : 'docent1',
label: 'Docent',
useClearIcon: true,
autoCapitalize: true
}, {
xtype: 'textfield',
name : 'lokaal1',
label: 'Lokaal',
useClearIcon: true
}]
});
var paneel = new Ext.TabPanel({
tabBar: {
dock: 'bottom',
layout: {
pack: 'center'
}
},
activeTab: 0,
fullscreen: true,
layoutOnTabChange: true,
ui: 'light',
cardSwitchAnimation: {
type: 'fade',
cover: true
},
defaults: {
scroll: 'vertical'
},
items: [{
title: 'Overzicht',
html: '<h1>iClassroom</h1><p>Welkom op de testpagina van iClassroom.</p>',
iconCls: 'home',
cls: 'card1'
}, {
xtype: 'container',
title: 'Lessen',
iconCls: 'rooster-icon',
icon: '../themes/images/default/pictos/calendar2.png',
items: form1,
layout: 'vbox',
cls: 'card2',
badgeText: '7',
anchor: '20%'
}, {
title: 'Huiswerk',
html: '<h1>Huiswerk</h1>',
cls: 'card3',
iconCls: 'bookmarks'
}, {
title: 'Projecten',
html: '<h1>Projecten</h1>',
cls: 'card4',
iconCls: 'team',
badgeText: '3'
}, {
title: 'Instellingen',
cls: 'card5',
iconCls: 'settings'
}],
});
}
});