Opened 11 years ago
Closed 11 years ago
#10060 closed enhancement (invalid)
Carry over attributes from markup to templated widgets
Reported by: | Adam Peller | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | Dijit | Version: | 1.3.2 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
When declared programmatically, arguments to the constructor are mapped to attributes in the widget's DOM according to attribute map. The unit test "attributeMap" in _Widget-attr demonstrates this.
It would be useful to allow attributes in markup to also have the same behavior and get mapped into the widget's DOM, for example:
<div dojoType="dijit.form.Button" class="myClass"></div>
Should retain 'myClass' on this.domNode, or wherever attributeMap says it should go, and be combined with any other classes declared by the template. Right now, "myClass" is clobbered by the template.
This would be useful, particularly for tools which wish to construct and consume widgets from markup.
Attachments (1)
Change History (2)
Changed 11 years ago by
Attachment: | Widget-attr.patch added |
---|
comment:1 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
the parser is required for this behavior. attributes don't get carried over when the widget constructor is used directly on a domnode.
apply to dijit/tests/_Widget-attr.html