Opened 11 years ago

Closed 11 years ago

#7605 closed defect (fixed)

dijit.tree.ForestStoreModel throws error on newItem

Reported by: rjones Owned by: bill
Priority: high Milestone: 1.2
Component: Dijit Version: 1.2beta
Keywords: Cc:
Blocked By: Blocking:

Description

If a dijit.tree.ForestStoreModel? is created with an store with 0 items an error is thrown during the store.newItem process because dijit.tree.ForestStoreModel?._requeryTop does not check to make sure that the root has children. One workaround is to extend dijit.tree.ForestStoreModel? and extend the _requeryTop function:

dojo.declare("dijit.tree.WorkingForestStoreModel?", [dijit.tree.ForestStoreModel?], {

/

  • dijit.tree.ForestStoreModel? has a bug that presents when you create
  • a model with an empty store and call newItem an error occurs because
  • the root has no children and there was no null check.
  • @Override */

_requeryTop: function(){

if ( this.root.children ) {

this.constructor.superclass._requeryTop.apply(this);

}

}

});

Attachments (3)

7605.html (1.4 KB) - added by bill 11 years ago.
testcase from bill, working
7605_error_example.html (2.1 KB) - added by rjones 11 years ago.
1 fix to example
7605_error_example.2.html (2.3 KB) - added by rjones 11 years ago.
Despite already being fixed, attaching best test example. Whith ability to show patch by using dijit.tree.WorkingForestStoreModel? from ticket description.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 11 years ago by bill

Milestone: 1.2tbd
Priority: highnormal
Resolution: worksforme
severity: criticalnormal
Status: newclosed

It works for me. I'm attaching the test case I used.

In the future, after creating a ticket, you need to attach full test cases using the Attach File button.

Changed 11 years ago by bill

Attachment: 7605.html added

testcase from bill, working

comment:2 Changed 11 years ago by rjones

Resolution: worksforme
Status: closedreopened

This is broken, I've uploaded test case now.

Changed 11 years ago by rjones

Attachment: 7605_error_example.html added

1 fix to example

comment:3 Changed 11 years ago by bill

Milestone: tbd1.2
Owner: set to bill
Status: reopenednew

Oh ok, thanks for the testcase, will fix.

comment:4 Changed 11 years ago by bill

Resolution: fixed
Status: newclosed

(In [15170]) Fixes #7605: dijit.tree.ForestStoreModel? throws error on newItem if no initial children. !strict

Changed 11 years ago by rjones

Attachment: 7605_error_example.2.html added

Despite already being fixed, attaching best test example. Whith ability to show patch by using dijit.tree.WorkingForestStoreModel? from ticket description.

Note: See TracTickets for help on using tickets.