PDA

View Full Version : [CLOSED-677] script error while adding duplicate records into the grid



ruralclimber
2 Mar 2010, 12:47 PM
Hi,

in 3.0 version,


store.load({


add:true

});



will add duplicate records into the grid, even the record id is specified in XMLReader.



in 3.1 version, looks this is not happening. However, I am getting script errors while trying to add a duplicate record into the grid.


---
A Runtime Error has occured. Do you wish to Debug?
Line:11
Error:'data' is null or not an object
---


the error is triggered in extjs core.



Is this an already known bug?



What I want is basically specified in the API.


if a duplicate record is added to the grid, it should be ignored (or say, replacing the existing one rather than adding a duplicate into the grid)



Thx
Warren

evant
31 Mar 2010, 1:10 AM
Ids must be unique for each record inside the store, this isn't a bug.

ruralclimber
7 Apr 2010, 9:25 AM
thx, understand that ID should be unique.

but I would expect the store silently and safely ignore the new duplicate record, rather than throwing out a script error.


just like a set, if you add a duplicate entry into the set, it will be simply ignored.



best,
Warren