PDA

View Full Version : Script run on PC, but iPod



tycoi2005
22 Feb 2011, 12:11 AM
Hi all,
this is my script:


Ext.regModel('Table',{
fields: [
{name: 'name', type: 'string'},
{name: 'order', type: 'boolean', defaultValue: false}
]
});

var tableList = new Ext.data.Store({
model: 'Table',
sorters: 'name',
data: [
{name: '100'},
{name: '101'},
{name: '102'},
{name: '103'}
]
});

var listTable = new Ext.List({
layout: 'fit',
multiSelect: true,
cls:'listTable',
fullscreen:true,
xtype: 'list',
store: tableList,
itemTpl: '<span>{name}</span>',
itemSelector: '.x-list-item',
listeners: {
itemtap: function (list, index, item){
panelMain.setActiveItem(panelFoods);
list.getRecord(item).set('order','true');
list.select(index, true, false);
}
}

});

var panelRoom = new Ext.Panel({
layout:'fit',
title: 'panel Rooms',
iconCls: 'user',
badgeText: 'bT',
items: [listTable]
});

// Order
var panelOrder = new Ext.Panel({
layout:'fit',
title: 'panel Order',
iconCls: 'compose',
items: []
});

//Foods
var panelFoods = new Ext.Panel({
layout:'fit',
title: 'panel Foods',
iconCls: 'bookmarks',
html:'panel Foods'
});

var panelMain = new Ext.TabPanel({
tabBar: {
dock: 'bottom',
ui: 'dark',
layout: {
type: 'hbox',
align: 'center',
pack: 'center'
}
},
fullscreen: true,
cardSwitchAnimation: 'slide',
items: [panelRoom, panelOrder, panelFoods]
});

Ext.setup({
fullscreen: true,
onReady:function(){
panelMain.show();
}
});


On PC, after click on an item, console throw me a warning: "DataView: select will be removed, please access select through a DataView's SelectionModel, ie: view.getSelectionModel().select()" on sencha-touch-debug.js:22873 and still work, but when i run on iPod, it show a blank page.
How can i fix it?

--------
When i shake iPod, the blank page change to show. But i don't know why

tycoi2005
4 Mar 2011, 2:09 AM
I solved this problem, thx everybody! :)


Ext.setup({
fullscreen: true,
onReady:function(){
var panelMain = new Ext.TabPanel({
tabBar: {
dock: 'bottom',
ui: 'dark',
layout: {
type: 'hbox',
align: 'center',
pack: 'center'
}
},
fullscreen: true,
cardSwitchAnimation: 'slide',
items: [panelRoom, panelOrder, panelFoods]
});
}
});