#1052 closed enhancement (wontfix)
proposing getWidget(id) method that would create a widget if it doesnt exists
Reported by: | dusan | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Widgets | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I am proposing helper method dojo.getWidget(id)
- if widget already exists it would just return it
- if it doesn't exists it would look for a node with given id and parse it into widget
dojo.getWidget(id){
var widget = dojo.widget.byId(id); if (widget) return widget; var xp = new dojo.xml.Parse(); return dojo.widget.getParser().createComponents(xp.parseElement(dojo.byId(id), null, true))[0];
}
It can be improved with createWidget() method after Ticket #1019 is resolved.
Change History (2)
comment:1 Changed 15 years ago by
Component: | Core → Widgets |
---|---|
Milestone: | 0.4 → 0.5 |
Owner: | changed from anonymous to bill |
Version: | 0.4 → 0.3 |
comment:2 Changed 14 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
This is simple enough that users can just implement it themselves if they need it, and I haven't heard a lot of demand for it.