#11325 closed enhancement (invalid)
Allow "data-" attributes in dijit widgets
Reported by: | peirix | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | Parser | Version: | 1.4.2 |
Keywords: | dijit html5 data attribute | Cc: | |
Blocked By: | Blocking: |
Description
When creating a dijit widget with some custom HTML5 "data-" attributes, they are removed in the widget, which is really unlucky as I have javascript that uses these "data-" attributes for hooks and information.
Change History (5)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Right now I'm using it to store a url inside a button that sits in a form. The url is used to do a AJAX call to somewhere else than the form action url.
comment:3 Changed 12 years ago by
Component: | Dijit → Parser |
---|---|
Owner: | set to bill |
severity: | major → normal |
Type: | defect → enhancement |
I don't understand your description, please attach a test case.
It seems like you've defined a custom widget with attributes like
// widget's URL parameter "data-url": ""
and then you are using the parser in conjunction with markup like this?
<div dojoType="myButton" data-url="my url">
comment:4 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Closing for lack of test case, please reopen after attaching one.
Note: See
TracTickets for help on using
tickets.
Dijits replace the original DOM node by that in the template, so typically custom attributes (unless defined on the Dijit class) don't survive.
Personally I prefer to treat
data-*
attributes as regular custom attributes which Dijit picks up, rather than as special attributes that are re-added to the rendered Dijit'sdomNode
.What is your JavaScript? doing that needs these attributes on the
domNode
, and are you perhaps better served by creating a subclass of the widget in question?