PDA

View Full Version : Positioning Panels



SoFierce
18 Apr 2011, 12:15 PM
Been looking all day for a answer to this...

Is it possible to place nested panels at fixed locations?

(ie top: 100, left: 125)

Any help would be greatly appreciated. If not possible, please let me know so I can look for an alternative solution.

The ultimate goal here is to have a small carousel on the current stage... carousel being smaller than width and height of stage

Cheers.

isibbot
19 Apr 2011, 2:52 AM
Hi, After reading this thread I came up with this code.

http://www.sencha.com/forum/showthread.php?120335-Tip-when-changing-a-component-to-floating-be-sure-to-hide-it-first



var caroPanel = new Ext.Carousel({
layout: {
type: 'card',
align: 'left',
},
items: [red, amber, green],
});

function makefloat(cmp) {
cmp.hide(); // comment this out and it screws up
rootPanel.remove(cmp, false);
cmp.setPosition(400, 100);
cmp.setFloating(true);
cmp.hideOnMaskTap = false;
cmp.show();
cmp.setHeight(400);
cmp.setWidth(300);
}

var rootPanel = new Ext.Panel({
fullscreen: true,
layout: 'fit',
items: [caroPanel],
style: 'background-color:#666; color:#ffffff;',
});


Not that elegant and I dont fully understand why setting the initial configs of the carousel that the makefloat function is setting doesnt work. Once I find out the what I'm missing out when trying to float panel "out the box" then I will post back.

Hope this helps

SoFierce
19 Apr 2011, 10:23 AM
Hello isibbot (again).

You have been the only responder to my posts. Thank you for your insight.

First and foremost, I'm more designer than developer...

I tested your code from the link provided for floating panels, and it works well. I also tested the code provided for floating a carousel and saw how it doesn't work. It's looking like I will have to find another development solution and would hate for you to spend anymore time on this... unless of course you want to.

Thanks again!

Cheers.

isibbot
20 Apr 2011, 12:23 AM
Hi, Thanks, I'm new to Sencha Touch, but not new to web developement and contributing back via forums. By my experience of the particular forum you wont find much help here. Unless its highly technical and excites the geeks.

I've a a hand full of quetions with plenty of views, but no replies. I think this forum is dead! Shame.No way to support and nuture the community that are your audience. :)

If your a designer, then may I suggest you'll need to edit and tweak any code to work in your personal project. The code I provided works. It produces a floating panel positioned away from the edge of the screen.~o)