My favorites | Sign in
Project Home Downloads
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 141: Having more than one tree on a page can lead to options conflicts during instantiation
1 person starred this issue and may be notified of changes. Back to list
Status:  Verified
Owner:  moo...@wwwendt.de
Closed:  May 2010


 
Reported by cfhdista...@gmail.com, Mar 31, 2010
What steps will reproduce the problem?
1. Create two or more dynatrees on a page with differing options (in 0.5.3)
2. Examine the options being set in _create

What is the expected output? What do you see instead?

Each tree should have a fresh, unique set of options combining the defaults
and the user supplied options

What version of the product are you using?

0.5.3

On what operating system and browser?

FF 3.6/Mac

Please provide any additional information below.

The new logic in _create is accidentally merging the user supplied options
during instantiations (this.options) into the baseline defaults in
$.ui.dynatree.defaults, so later invocations of trees will now use a
modified version of the global defaults, causing unexpected results.

See _create:

	_create: function() {
    	if( parseFloat($.ui.version) >= 1.8 ) {
    		this.options = $.extend(true,
$[this.namespace][this.widgetName].defaults, this.options);
    	}


should probably be

	_create: function() {
    	if( parseFloat($.ui.version) >= 1.8 ) {
    		this.options = $.extend(true, {},
$[this.namespace][this.widgetName].defaults, this.options);
    	}

as the deep copy version of .extend will use the second parameter as the
target. In the shipping 0.5.3, this will aggregate user supplied values
into the defaults. The proposed second version creates a fresh copy
combining the defaults with the user supplied options, and returning those
into the per-instance copy of the options.
Apr 10, 2010
Project Member #1 moo...@wwwendt.de
(No comment was entered for this change.)
Status: Accepted
Owner: moo...@wwWendt.de
Labels: Milestone-Release0.5.4
May 4, 2010
Project Member #3 moo...@wwwendt.de
thanks
Status: Fixed
Jul 17, 2012
Project Member #4 moo...@wwwendt.de
considered verified
Status: Verified

Powered by Google Project Hosting