PDA

View Full Version : Newbie problem positioning panels



Gary Pickrell
15 Jan 2011, 4:41 PM
Hello,

I'm positioning text over an image. Both are panels and are updated. I can position both panels just fine individually, but together they jump around. It gets worse when I add additional panels. I'd like to figure out how to absolutely position a panel and change the html content. If I try setting float: true the panels vanish. Here is my simplified code.

var QuizPanel;
var TitlePanel;

function createPanel()
{
TitlePanel = new Ext.Panel({
html: '<h1>Question 1</h1>',
x: 0,
y: 0,
//floating: true
});

QuizPanel = new Ext.Panel( {
items: [TitlePanel],
html: '<image src="images/q1.png"/>',
x: 0,
y: 0,
click: { element: 'el', fn: clickEvent }
return QuizPanel;
}

function clickEvent()
{
TitlePanel.update('<h1>Question 1</h1>');
QuizPanel.update('<image src="images/q2.png"/>');
}

All brilliancies are welcome.

-Gary