Opened 13 years ago
Closed 13 years ago
#6696 closed defect (fixed)
dojo.declare doesn't allow mixins that aren't declared with dojo.declare
Reported by: | guest | Owned by: | sjmiles |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Core | Version: | 1.1.0 |
Keywords: | declare | Cc: | [email protected]… |
Blocked By: | Blocking: |
Description (last modified by )
The destroy method doesn't work on the Grid at the moment. It produces an error message saying something about not finding the m.findMixin method.
The reason for this error is because of the inheritance of VirtualGrid? from _Events, or more precisely it is because of the way _Events is defined. _Events does not use dojo.declare. Instead it is created as an empty function which is then dojo.extend'ed with methods.
To fix the Grid destroy method, _Event just needs to be defined using dojo.declare. Below is how _Event should be declared to resolve this bug.
dojo.provide("dojox.grid._Events"); dojo.declare("dojox.grid._Events", null, { /* _Events methods go here */ });
Attachments (1)
Change History (12)
Changed 13 years ago by
Attachment: | test_grid_programmatic.html added |
---|
comment:1 Changed 13 years ago by
Owner: | changed from sorvell to bryanforbes |
---|---|
Priority: | normal → high |
comment:2 follow-up: 3 Changed 13 years ago by
Milestone: | → 1.2 |
---|
comment:3 Changed 13 years ago by
comment:4 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Owner: | changed from bryanforbes to Bryan Forbes |
comment:6 Changed 13 years ago by
Component: | DojoX Grid → Core |
---|---|
Description: | modified (diff) |
Keywords: | declare added; grid destroy _Events removed |
Owner: | changed from Bryan Forbes to sjmiles |
After looking at this, I've found that this is the problem:
dojox.grid._Events = function(){}; dojo.extend(dojox.grid._Events, { /* some functions and stuff */ }); dojo.declare("dojox.grid.VirtualGrid?", [ dijit._Widget, dijit._Templated, dojox.grid._Events ], {
/* more stuff here */
});
This should be valid. I want to show in the declaration of VirtualGrid? (and thus, in the API documentation) that it mixes _Events onto itself. Since _Events is being used as a mixin, it shouldn't have to have anything special about it. There should be a check in declare to make sure that "findMixin" is actually on the object you're working with.
comment:7 Changed 13 years ago by
Description: | modified (diff) |
---|
Sorry, I forgot to use wiki formatting for the code example:
dojox.grid._Events = function(){}; dojo.extend(dojox.grid._Events, { /* some functions and stuff */ }); dojo.declare("dojox.grid.VirtualGrid", [ dijit._Widget, dijit._Templated, dojox.grid._Events ], { /* more stuff here */ });
comment:8 Changed 13 years ago by
Description: | modified (diff) |
---|---|
Summary: | VirtualGrid.destroy doesn't work because of inheritance of _Events → dojo.declare doesn't allow mixins that aren't declared with dojo.declare |
Updated the summary and made the description a bit shorter.
comment:9 Changed 13 years ago by
Was this bug corrected?. The destroy method seems to work again in the last nightly build.
Eduardo
comment:10 Changed 13 years ago by
comment:11 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
dojox.grid._Events is now defined via declare, which I believe has fixed the "grid destroy" problem, but in any case I've added a test for existence of "_findMixin" to declare.
Replying to dante:
Hi Dante,
Is it possible to rise a bit the priority of this bug ?. It is pretty critical, the problem (as you can see in the attached file I placed) the destroy simple crash, so any command after it will not be executed, "destroy" is a pretty important method in grid. This problem was introduced in the nightly build of the 7/5/2008, in the 6/5/2008 it was ok
Thanks very much