Index: js/widgets/Grid.js =================================================================== --- js/widgets/Grid.js (Revision 80491) +++ js/widgets/Grid.js (Arbeitskopie) @@ -43,7 +43,6 @@ "dojo/aspect", "dojo/on", "dojo/window", - "dijit/Destroyable", "dijit/Menu", "dijit/MenuItem", "dijit/form/DropDownButton", @@ -64,11 +63,11 @@ "../render", "../i18n!" ], function(declare, lang, array, kernel, win, construct, attr, geometry, style, domClass, - topic, aspect, on, dojoWindow, Destroyable, Menu, MenuItem, DropDownButton, entities, + topic, aspect, on, dojoWindow, Menu, MenuItem, DropDownButton, entities, OnDemandGrid, Selection, DijitRegistry, Selector, StoreAdapter, Memory, Button, Text, ContainerWidget, StandbyMixin, Tooltip, _RegisterOnShowMixin, tools, render, _) { - var _Grid = declare([OnDemandGrid, Selection, Selector, DijitRegistry, Destroyable], { + var _Grid = declare([OnDemandGrid, Selection, Selector, DijitRegistry], { getItem: function(item) { // For legacy dojox grid compability // e.g. formaters that expect to be working with a dojox grid @@ -409,17 +408,17 @@ // register event handler // - this._grid.on('dgrid-select', lang.hitch(this, '_selectionChanged', true)); - this._grid.on('dgrid-deselect', lang.hitch(this, '_selectionChanged', false)); + this.own(this._grid.on('dgrid-select', lang.hitch(this, '_selectionChanged', true))); + this.own(this._grid.on('dgrid-deselect', lang.hitch(this, '_selectionChanged', false))); - this._grid.on(".dgrid-row:contextmenu", lang.hitch(this, '_updateContextItem')); + this.own(this._grid.on(".dgrid-row:contextmenu", lang.hitch(this, '_updateContextItem'))); - this.on('filterDone', lang.hitch(this, '_updateGlobalCanExecute')); + this.own(this.on('filterDone', lang.hitch(this, '_updateGlobalCanExecute'))); - this._grid.on('dgrid-refresh-complete', lang.hitch(this, '_cleanupWidgets')); + this.own(this._grid.on('dgrid-refresh-complete', lang.hitch(this, '_cleanupWidgets'))); - aspect.after(this._grid, '_updateHeaderCheckboxes', lang.hitch(this, '_updateHeaderSelectClass')); - aspect.before(this._grid, '_updateHeaderCheckboxes', lang.hitch(this, '_updateAllSelectedStatus')); + this.own(aspect.after(this._grid, '_updateHeaderCheckboxes', lang.hitch(this, '_updateHeaderSelectClass'))); + this.own(aspect.before(this._grid, '_updateHeaderCheckboxes', lang.hitch(this, '_updateAllSelectedStatus'))); if (this.query) { this.filter(this.query); @@ -558,10 +557,10 @@ }); } this.own(container); - container.on('click', lang.hitch(this, function() { + this.own(container.on('click', lang.hitch(this, function() { var idProperty = this.moduleStore.idProperty; defaultAction.callback([item[idProperty]], [item]); - })); + }))); return container.domNode; }); } @@ -781,9 +780,9 @@ // add buttons to toolbar array.forEach(buttons.$order$, function(ibutton) { this._toolbar.addChild(ibutton); - ibutton.on('click', lang.hitch(this, function() { + this._toolbar.own(ibutton.on('click', lang.hitch(this, function() { this._publishAction(ibutton.name); - })); + }))); }, this); },