Opened 9 years ago

Closed 9 years ago

#15841 closed defect (fixed)

dijit/Menu change breaks documented dijit/Tree context menu backward compatibility

Reported by: rtasarz Owned by:
Priority: undecided Milestone: 1.8
Component: Dijit Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:


After upgrade from 1.7.2 to 1.8.0 integration of context menu for dijit.Tree from no longer works as documented. That's because calling dijit.getEnclosingWidget() in old version returns instance of dijit._TreeNode where new one returns dijit.Tree. I haven't investigated yet why the change was made, but problem is caused by Menu.js line 170 call of self._scheduleOpen which now gets this as first argument instead of New call looks cleaner, but breaks documented use cases, so I'm not sure if change should be reverted and delayed till 2.0 or just mentioned in some docs. In the meantime best workaround I've found so far is:

 aspect.before(menu, "_openMyself", function(args){
       var rn = win.doc.elementFromPoint(args.coords.x, args.coords.y);
       var tn = dijit.getEnclosingWidget(rn);

Change History (1)

comment:1 Changed 9 years ago by bill

Component: GeneralDijit
Milestone: tbd1.8
Resolution: fixed
Status: newclosed

Yes, that's why the new version of the reference guide documents the new way to do context menus. It's also discussed in the 1.8 release notes.

Note: See TracTickets for help on using tickets.