Opened 14 years ago
Closed 14 years ago
#3387 closed enhancement (fixed)
implement scoped <script type="dojo/connect"> system for declaratively created instances
Reported by: | alex | Owned by: | alex |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Core | Version: | 0.9 |
Keywords: | parser, markup, behavior, widget, 4dijit | Cc: | owenw |
Blocked By: | Blocking: |
Description
as discussed at length with owen and eugene, the system needs to augment programmatic widget and class instance creation with the ability to specify behaviors for instances in a declaration. These behaviors should be scoped correctly.
Change History (7)
comment:1 Changed 14 years ago by
comment:3 Changed 14 years ago by
There is a bug in the committed code
suffic should be suffix ->
function wireUpConnect(instance, script){ var withStr = script.getAttribute("with"); var preamble = ""; var suffix = ""; if(withStr && withStr.length){ dojo.forEach(withStr.split(/s*,s*/), function(part){ preamble += "with("+part+"){"; suffic += "}"; }); }
comment:4 Changed 14 years ago by
comment:5 Changed 14 years ago by
comment:6 Changed 14 years ago by
Keywords: | 4dijit added |
---|
Alex and I discussed this feature a week or two ago. I think the conclusions were:
- change <script type="dojo/connect"> to <script type="dojo/method">, since users will be overriding methods more often than connecting to them.
- specify argument list like <script type="dojo/method" ... args="a,b,c">
- the specified methods get mixed in to the widget instance the same way as <button dojoType=... onclick="..."> gets mixed in
- if you need code to execute before the constructor then connect to preamble
comment:7 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
(In [9062]) first cut of a <script type="dojo/connect"> system. Refs #3387