PDA

View Full Version : Unable to set panel size



taymoor
14 Jul 2011, 9:15 PM
Hi guyz,
i am new to Sencha Touch and having problems in setting size of panel. I am trying to create a custom panel and dont want it to occupy full screen. Below is the code. When i run it nothing shows up on my screen. when i pass "fullscreen:true" it displays but occupy fullscreen and i dont want that

//creating custom panel
//inheriting from panel
sharedApp.ShopProductView = Ext.extend(Ext.Panel, {

id : 'mainPanel',
style: "background: url(./bgImage.gif)",
width: 320,
height: 600,
initComponent: function(){
sharedApp.ShopProductView.superclass.initComponent.call(this);
},
items : [{
html: 'Welcome to My App!'
}
]
}
);

// creating application

new Ext.Application({
name:"sharedApp",
launch: function(){
sharedApp.panel = new sharedApp.ShopProductView();
this.viewport = sharedApp.panel;
}
});

bwg
14 Jul 2011, 10:34 PM
Watch the screencasts for Panels and Layouts if you haven't already:

http://www.sencha.com/learn/intro-to-panels/
http://www.sencha.com/learn/intro-to-layouts/

In fact, make sure you go through all the screencasts.

StuartAshworth
15 Jul 2011, 1:29 AM
Try adding floating: true to your config.

taymoor
18 Jul 2011, 3:26 AM
Thanx bwg and stoot98. I have already gone through these two tutorials and tried by adding floating:true to config but nothing helped:( any other suggestion?? keep in mind that i am trying to set size of my base panel and setting it as viewport