Ticket #7605 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

dijit.tree.ForestStoreModel throws error on newItem

Reported by: rjones Owned by: bill
Priority: normal Milestone: 1.2
Component: Dijit Version: 1.2beta
Severity: normal Keywords:
Cc:

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

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

Change History

Changed 10 months ago by bill

  • priority changed from high to normal
  • status changed from new to closed
  • resolution set to worksforme
  • severity changed from critical to normal
  • milestone changed from 1.2 to tbd

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 10 months ago by bill

testcase from bill, working

Changed 10 months ago by rjones

  • status changed from closed to reopened
  • resolution deleted

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

Changed 10 months ago by rjones

1 fix to example

Changed 10 months ago by bill

  • status changed from reopened to new
  • owner set to bill
  • milestone changed from tbd to 1.2

Oh ok, thanks for the testcase, will fix.

Changed 10 months ago by bill

  • status changed from new to closed
  • resolution set to fixed

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

Changed 10 months ago by rjones

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.