Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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:


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 Mark Wubben

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's domNode.

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?

comment:2 Changed 12 years ago by peirix

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 bill

Component: DijitParser
Owner: set to bill
severity: majornormal
Type: defectenhancement

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 bill

Resolution: invalid
Status: newclosed

Closing for lack of test case, please reopen after attaching one.

comment:5 Changed 12 years ago by bill

See also #11490.

Note: See TracTickets for help on using tickets.