Custom Control [message #549721] |
Tue, 27 July 2010 17:00 |
|
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 |
Philipp Eichhorn 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.03639 seconds