Opened 14 years ago

Closed 14 years ago

#248 closed defect (fixed)

creating floating pane fromScript doesn't work?

Reported by: anonymous Owned by: anonymous
Priority: high Milestone:
Component: Widgets Version: 0.1
Keywords: Cc:
Blocked By: Blocking:

Description

I'm trying to create a number of floating panes with the use of the widget.fromScript method, but it doesn't seem to work.

The code I use is:

function testFill(number) {
	for(i=0; i<number; i++) {
		createPane("pane"+i,"pane title "+i,"content"+i);
	}
}

function createPane(xpaneId, xpaneTitle, xpaneContent) {
	
	var xpane = dojo.widget.fromScript("FloatingPane", {widgetId:xpaneId, title:xpaneTitle, constrainToContainer:"true", width="200px", height:"200px"});

	xpane.innerHTML = xpaneContent;
	document.getElementById("paneContainer").appendChild(xpane.domNode);
}

After testing a number of things, I found that only the pane width and height are not properly set. I get only a number of small title bars with the set titles and I'm only able to move the title bars from left to right and back.

Martin

Change History (2)

comment:1 Changed 14 years ago by bill

Well, width="200px" should be width:"200px". If you fix that error in your script is there still a problem?

comment:2 Changed 14 years ago by bill

Resolution: fixed
Status: newclosed

Actually, I forgot to say that FloatingPane? and LayoutPane? require the user to first create a div w/the appropriate dimensions. Something like this:

var div = document.createElement("div); div.style.width="200px"; div.style.height="200px"; var xpane = dojo.widget.fromScript("FloatingPane?", {widgetId:xpaneId, title:xpaneTitle, constrainToContainer:"true"}, div);

Note: See TracTickets for help on using tickets.