Opened 13 years ago

Closed 12 years ago

#2636 closed defect (wontfix)

Filtering table Store addDataRange updateDataRange

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

Description

You cannot add 2 records with the same Id in the same data range if they did not previously exist. The reason for this is that you call the code for replaced objects prior to calling the code for new objects. It blows up because it tries to replace a row that does not exist yet. I'm sure you just need to switch the order of the code shown below. It's in Store.addDataRange and Store.addDataRangeByIndex

                if(!bDontFire){
                        if(replacedObjects.length>0){
                                this.onUpdateDataRange(replacedObjects);
                        }
                        if(newObjects.length>0){
                                this.onAddDataRange(newObjects);
                        }
                }

Also in case it has not been resolved already from a past ticket, in FilteringTable? old is returning null,

		dojo.event.connect(this.store, "onUpdateDataRange", function(arr){
			for(var i=0; i<arr.length; i++){
				var var old=self.getRow(self.store.getDataByKey(arr[i][self.store.keyField]));
				var row=self.createRow(arr[i]);
				self.domNode.tBodies[0].replaceChild(row, old);
			};
			self.render();
		});


I changed:

var old=self.getRow(self.store.getDataByKey(arr[i][self.store.keyField]));

to:

var old=self.getRow(self.store.getDataByKey(arr[i].key));

Change History (1)

comment:1 Changed 12 years ago by bill

Resolution: wontfix
Status: newclosed

This is all being redone for the new Table widget, so won't fix it for FilteringTable?.

Note: See TracTickets for help on using tickets.