Opened 14 years ago
Closed 13 years ago
#3211 closed defect (fixed)
Can not create a ContentPane without source node
Reported by: | guest | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | Dijit | Version: | 0.9 |
Keywords: | Cc: | bill | |
Blocked By: | Blocking: |
Description
It is not possible to create a new ContentPane? without source node.
// this throws no error var div1 = document.createElement("div"); var newCp = new dijit.layout.ContentPane({id:"newCp"}, div1); // this throws an error var tmp = new dijit.layout.ContentPane({id:"newCp3"} );
I tested some other widgets and can create them without the source node.
Change History (8)
comment:1 Changed 14 years ago by
Owner: | changed from bill to mumme |
---|
comment:2 Changed 14 years ago by
Cc: | bill added |
---|
comment:3 Changed 14 years ago by
Milestone: | 0.9 → 1.0 |
---|
Right, it's like you said. Most widgets don't have this issue because most widgets have templates. As for that one line fix, it's a little inefficient because for widgets with templates it's unnecessary (and creates then abandons that div node).
Hmm, let's think about this one.
comment:4 Changed 13 years ago by
Owner: | changed from mumme to bill |
---|
Bill, I don't think this ticket really "belongs" to me.
I'm not involved deeply enough in the development to make this call, Its not just ContentPane?'s, its every widget without Template.
comment:5 Changed 13 years ago by
Milestone: | 1.0 → 2.0 |
---|
comment:7 Changed 13 years ago by
Milestone: | 2.0 → 1.0 |
---|---|
Status: | new → assigned |
comment:8 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
Ok due to the way dijit._Widget is set up it means this fix would have to go in dijit._Widget constructor function. At least thats the only way I see it (without bloat in ContentPane? regarding domNode.id -> widget.id etc.).
That means we will always create a DIV if srcNodeRef isn't present. It is a simple 1 liner fix, but it might be bad for runtime on some other widgets.
Question is should we really support automagical domNode construction in 0.9?