Skip to Main Content

DevOps, CI/CD and Automation

OJ-Tree-View: Error JET TreeView nodes should not have duplicated keys: undefined

User_D433JSep 14 2022

Hi All,
I'm getting an error message with my tree view. Below is a small sample code I wrote to test dynamically populating a tree-view.
objData = ko.observableArray([
{title:"Default", id:"default"}
objData.push({title: "Print", id: "print"});

_const newNode = objData.slice(0,1);_  
_newNode\["children"\] = new ko.observableArray(\[{title: "Child1", id: "child1"}\]);_  
_objData.splice(0, 1, newNode);_ = ko.observable(new ArrayTreeDataProvider(objData, { keyAttributes: "id" }));_  

However when I expand the first tree node, it gives me an error nodes should not have duplicated keys. Also the first value no longer reads default. Where am I going wrong with the code? Thanks.

Post Details
Added on Sep 14 2022