Opened 9 years ago
Closed 8 years ago
#13981 closed defect (patchwelcome)
dojox.grid._View._cleanupRowWidgets damages nested widgets
Reported by: | Yasir Assam | Owned by: | Evan |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | DojoX Grid | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
If you use a widget with nested widgets (composite widget?) in a TreeGrid (and possibly other grid types), function dojox.grid._View._cleanupRowWidgets will remove the nested widget DOM nodes from the widgets.
I spotted this bug when expanding a TreeGrid cell being edited (the widget was active).
Perhaps this is related to #13908?
In any case, here's what I've written to fix the bug:
dojo.extend(dojox.grid._View, { _cleanupRowWidgets: function(inRowNode) { // Summary: // This overrides dojox.grid._View._cleanupRowWidgets // which can't handle widgets with nested widgets if(inRowNode){ var nestedWidgets = dojo.query("[widgetId] [widgetId]", inRowNode).map(dijit.byNode); dojo.forEach(dojo.query("[widgetId]", inRowNode).map(dijit.byNode), function(w){ if (dojo.indexOf(nestedWidgets, w) == -1) { if(w._destroyOnRemove){ w.destroy(); delete w; }else if(w.domNode && w.domNode.parentNode){ w.domNode.parentNode.removeChild(w.domNode); } } }); } } });
Change History (2)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Resolution: | → patchwelcome |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
DojoX Grid and EnhancedGrid are deprecated in favor of dgrid and gridx.
You should upgrade your code to use one of those two grids.
We will consider patches to the old DojoX Grid code though.