Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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: glausinger@…
Blocked By: Blocking:

Description (last modified by bill)

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)

example.zip (1.7 KB) - added by popeye 8 years ago.
Example source code générating dojo error

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by popeye

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)

comment:2 Changed 8 years ago by Jared Jurkiewicz

Component: DataDijit
Owner: changed from Jared Jurkiewicz to bill

comment:3 Changed 8 years ago by bill

Description: modified (diff)
Summary: Problem in ForestStoreModel after migrating from Dojo 1.3.0 to 1.6.1Tree: 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.

Changed 8 years ago by popeye

Attachment: example.zip added

Example source code générating dojo error

comment:4 Changed 8 years ago by bill

Resolution: invalid
Status: newclosed

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 8 years ago by bill

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 8 years ago by bill

Resolution: invalidworksforme
Note: See TracTickets for help on using tickets.