Closed pandabytes closed 5 months ago
This method is used to replace ids with the those generated in the backend: https://github.com/plamen-peshev/FamilyTreeJSGenerateNewNodesIdsFromServerSide/tree/master/FamilyTreeJSGenerateNewNodesIdsFromServerSide
Yep. I understand what method does but I'm unsure of how to call this method correctly because, as described above
// Usage 1 - Throw exception
family.replaceIds({1: 'a', 2: 'b'});
// Usage 2 - Ok
family.replaceIds({1: 'a'});
family.replaceIds({2: 'b'});
I don't know how exactly the method works, but the ids that are replaced are generated from the chart for the new nodes. We don't replace already existing nodes, as their id's are already taken from the server. Please try the same case as in our GitHub example.
Perhaps I'm not being cleared. I understand the purpose of the method, but it throws an exception when I pass an object with multiple ids in which I think it's supposed to do. So my question is, is this a bug?
Yes, may be it is a bug. We will check and will write you again.
We have addressed the issue in the lates release
You can test this Code demo (before testing lcear your browser cache)
Thank you!
Hello. Thank you for the great library!
Issue
I ran into an issue with
familyTree.replaceIds
. This method throws an exception when I pass in multiple ids like this:familyTree.replaceIds({ 1: 'a', 2: 'b' })
. However it works fine if I break the ids into individual objects so like this:The exception is displayed in the chrome devtool console:![image](https://github.com/BALKANGraph/FamilyTreeJS/assets/18756606/65aef267-6de0-4420-8504-04d83c1a8102)
Code example