#5004 closed defect (fixed)
QueryReadStore and Proto*cough* incompatible [patch] [cla]
Reported by: | guest | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | high | Milestone: | 1.0.1 |
Component: | DojoX Data | Version: | 0.9 |
Keywords: | prototye queryreadstore | Cc: | |
Blocked By: | Blocking: |
Description
The way the data.items is iterated through in QueryReadStore? throws an exception if Prototype 1.5 is loaded side-by-side because of the methods that Prototype adds to Array.prototype. While I can't justify use of prototype, in the real-world it happens and so compatibility should be strived for. The attached patch will iterate over the array using dojo.forEach which appropriately deals with the case.
CLA on file
Attachments (2)
Change History (10)
Changed 13 years ago by
comment:1 Changed 13 years ago by
Milestone: | 1.0 → 1.0.1 |
---|
you should be able to pass 'this' in to dojo.forEach as an additional arg and avoid the qme decl
comment:4 Changed 13 years ago by
fwiw you can probably just
dojo.forEach(data.items,function(e){ this._items.push({i:e, r:this}); },this);
comment:5 Changed 13 years ago by
to test this thing you can try to extend Array.prototype. the dojo.forEach knows not to use array.length (which counts the funny functions that get added to the prototype) to iterate through the array members.
The exception you get when you extend Array.prototype is some sort of complaint about identifier defined but not a part of such-and-such an item (the function that extends Array.prototype, it turns out).
So the test case is to include the other javascript library (or manually extend Array.prototype) and then load a dataset with the identifier (from {identifier: id, items:[{...},...]}) specified into a combobox or unit test suite.
comment:6 Changed 13 years ago by
XmlStore? is also broken on this, by the by. I just fixed it too, using similar fixes. Will be generating a patch shortly.
Changed 13 years ago by
Attachment: | dojox.data.XmlStore_QueryStore_20071113.patch added |
---|
Updated patch for QueryReadStore? and XmlStore? + a fix for another bug found in the QueryReadStore?.html file
comment:7 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [11507]) Fixes for prototype compatibility. Also fixed another bug in the simple QueryReadStore?.html test file. fixes #5004
query read store works with prototype if you replace for(i ... array ... ) with dojo.forEach