Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2370 closed defect (fixed)

Copy-Paste error in dojo.collections.Store

Reported by: guest Owned by: Tom Trenka
Priority: high Milestone:
Component: Collections Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

Description

In the dojo.collections.Store class, a copy-paste error occured when coding the addDataRange method.

In fact, addDataRange method uses the code of the addData method. Here is the bug :

this.addDataRange = function(/*array*/arr){
		//	summary
		//	Add a range of objects to the internal data array.
		var objects=[];
		for(var i=0; i<arr.length; i++){
			var k = arr[i][this.keyField];
			if(this.getByKey(k)){
				var o = this.getByKey(k);
				o.src = obj;
			} else {
				var o = { key:k, src:arr[i] };
				data.push(o);
			}
			objects.push(o);
		}
		this.onAddDataRange(objects);
	};

During execution, a Javascript error "obj is not defined" shows up. In the for loop, the line :

o.src = obj;

may be :

o.src = arr[i];

Change History (4)

comment:1 Changed 12 years ago by dylan

Milestone: 0.9

comment:2 Changed 12 years ago by Tom Trenka

Resolution: fixed
Status: newclosed

(In [7161]) Fixes #2370.

comment:3 Changed 12 years ago by Tom Trenka

Milestone: 0.90.4.2

comment:4 Changed 12 years ago by (none)

Milestone: 0.4.2

Milestone 0.4.2 deleted

Note: See TracTickets for help on using tickets.