#13361 closed defect (worksforme)
Tree: Problem in ForestStoreModel after migrating from Dojo 1.3.0 to 1.6.1
Reported by: | popeye | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | Dijit | Version: | 1.6.1 |
Keywords: | JSONRestStore ForestStoreModel Dojox Dijit Tree | Cc: | [email protected]… |
Blocked By: | Blocking: |
Description (last modified by )
Hi,
On Firefox 4.0, firebug send me "Error loading root children" and "TypeError?: _12.item is undefined" when trying to lazy-load the root childrens of a Tree (based on ForestModel based on JsonRestStore) but there's no problems in Dojo 1.3.0. On IE6, i have a "Out of Memory error on line 15" (no bugs with Dojo 1.3.0)
Is there any syntax change from 1.3.0 to 1.6.1 ? I tried other Dojo versions (1.6.0, 1.5, 1.4) but only 1.3.0 seems to be ok with this code.
Here's the code that populate my Dijit.Tree. The POST Response of my "navigate.php" page is always ok with every Dojo version.
var treeStore= new dojox.data.JsonRestStore({ target: "navigate.php", idAttribute: "CODE", schema: { 'description':'Un noeud', 'type':'object', 'properties': { 'CODE': {'type':'number'}, 'EST_DOSSIER': {'type':'number'}, 'LIBELLE' : {'type':'string'}} } }); var treeModel = new dijit.tree.ForestStoreModel({ store: treeStore, rootId: 0, rootLabel: "Navigateur", query: { 'dossier': '0' }, labelAttr: "LIBELLE", childrenAttrs: ["children"] }); dojo.addOnLoad(function() { dojo.connect( treeModel, "getChildren", function( parentItem, complete_cb, error_cb ) { if(parentItem.root) return this.inherited(parentItem,complete_cb,error_cb); var id = this.store.getValue(parentItem, 'CODE'); this.store.fetch({ query: { format: 'json', dossier: id }, onComplete: complete_cb, onError: error_cb }); } );
Attachments (1)
Change History (7)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Component: | Data → Dijit |
---|---|
Owner: | changed from Jared Jurkiewicz to bill |
comment:3 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Summary: | Problem in ForestStoreModel after migrating from Dojo 1.3.0 to 1.6.1 → Tree: Problem in ForestStoreModel after migrating from Dojo 1.3.0 to 1.6.1 |
No idea what's going on. If you can attach a small test case I can take a look. Otherwise I won't be able to debug it.
comment:4 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
I checked your example source code. I tried opening "Item 1" and get an error. The issue is that you specified "children" as the attribute containing the list of children, yet there's no such attribute in the item:
item Object { CODE="1", LIBELLE="Item 1", more...} CODE "1" EST_DOSSIER "1" LIBELLE "Item 1" __id "navigate2.php/1" __parent [Object { CODE="1", LIBELLE="Item 1", more...}, Object { CODE="2", LIBELLE="Item 2", more...}, Object { CODE="3", LIBELLE="Item 3", more...}, Object { CODE="4", LIBELLE="Item 4", more...}]
I don't see how this could have worked in 1.3 either.
comment:5 Changed 11 years ago by
PS: were you implying that the page gets an error on load, before trying to expand any of the tree branches? I don't have FF4 anymore, since it auto-upgraded to FF5, but anyway FF5 and IE6 both worked fine for me. I tried against the latest trunk code and also 1.6/.
comment:6 Changed 11 years ago by
Resolution: | invalid → worksforme |
---|
I run my script with Full uncompressed Dojo 1.6.1.
Here's is the console of firebug on Firefox 4.0: Resuming debugger: error during debugging loop: TypeError?: firstViewRangeElement is null
error loading root children:
TypeError?: args.item is undefined [Stopper sur une erreur] (683 out of range 568)