Opened 8 years ago
Closed 8 years ago
#16713 closed defect (invalid)
registry.byNode is broken when trying to get toolbar widget
Reported by: | rag | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Dijit | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I am creating a toolbar. I require to not have 'id' attributes on the <div> elements because an application requeriment states that this toolbar will be inside a tab and any number of tabs could be created.
So, I was just declaring toolbars on makrup to let the parser create the widgets for me. Everything worked as desired.
Next step: attach events to toolbar buttons. My idea: get the toolbar <div> using the 'class' attribute, then get its children and, lastly, attach events to these children.
So...:
- I get the <div> of the toolbar with 'dojo/query'. The node is returned correctly.
- Then, I tried to get the widget with 'dijit/registry.byNode'... And boom! This function crashes and the script stops.
I isolated the problem in JSFiddle, you can see the Html markup and the javascript I am using here:
I don't know if I am doing something wrong...
At least one problem with your example code, which could presumably see by using any debugger (IE, Firefox, Chrome, etc.): dojo/query returns an array and you are passing that, rather than a node, to registry.byNode().
I also don't see how the parser is getting called in your example.