Custom Control [message #549721] |
Tue, 27 July 2010 17:00 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
|
Hi, I'm creating a custom control wrapping a control from YUI, but this control needs a div element.
<div id="calContainer"></div>
var c = new YAHOO.widget.Calendar("calContainer", configOptions);
I don't know how to create a div that is child of my custom control in qooxdoo, the only way I can create it is with the document object:
document.createElement( "div" );
But this places the control outside the application's frame.
Can you help me creating this div in order to be a child of my custom control?
|
|
|
Re: Custom Control [message #549743 is a reply to message #549721] |
Tue, 27 July 2010 19:18 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Philipp Eichhorn![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=peichhor%40web.de) Messages: 8 Registered: December 2009 |
Junior Member |
|
|
Hi Jesus,
I believe this simple skeleton should do the trick, although there are probably better solutions involving qooxdoo API:
qx.Class.define("custom.widget.dummy", {
extend: qx.ui.layout.CanvasLayout,
construct: function(id) {
this.base(arguments);
this.setHtmlAttribute("id", id);
this.__id = id;
// ...
},
// ...
members : {
load : function () {
qx.ui.core.Widget.flushGlobalQueues();
var element = document.getElementById(this.__id);
// create DIV
document.createElement("YOUR_DIV");
// append it as a child
element.appendChild(document);
// ...
}
// ...
}
}
Just pass the widget id in your LCA, when creating the widget:
String id = WidgetUtil.getId(widget);
writer.newWidget("custom.widget.dummy", new Object[] { id });
[Updated on: Tue, 27 July 2010 19:23] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.66541 seconds