You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewError("Each data element must implement a unique 'id' property");
}
idxById[id]=i;
}
}
and the function ensureIdUniqueness yet again checks checks that every data item has id property defined and verifies that idxById references that item (which is true by construction in updateIdxById)
thrownewError("Each data element must implement a unique 'id' property");
}
}
}
I would rather remove that unnecessary call to ensureIdUniqueness and the definition of that function since it is not used anywere else. I can push a pull request if you OK that change.
The text was updated successfully, but these errors were encountered:
closing since after trying the suggestion, the error is not thrown when we really have duplicate, so unfortunately the suggestion doesn't seem to be valid
I think the issue is that updateIdxById assigns the reverse lookup and if there are duplicates, the last one wins and the previous references to that ID are overwritten. ensureIdUniqueness goes through and checks that the reverse lookups resolve correctly, which they won't if something has been overwritten.
Hi!
It really seems that a call to
ensureIdUniqueness
right afterupdateIdxById()
is superfluous infunction setItems
SlickGrid/slick.dataview.js
Lines 130 to 139 in 427e2bf
because when the function
updateIdxById
traversesitems
, it checks that every data item has id property defined and buildsidxById
arraySlickGrid/slick.dataview.js
Lines 104 to 114 in 427e2bf
and the function
ensureIdUniqueness
yet again checks checks that every data item has id property defined and verifies thatidxById
references that item (which is true by construction inupdateIdxById
)SlickGrid/slick.dataview.js
Lines 116 to 124 in 427e2bf
I would rather remove that unnecessary call to
ensureIdUniqueness
and the definition of that function since it is not used anywere else. I can push a pull request if you OK that change.The text was updated successfully, but these errors were encountered: