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
I am trying to create a treeview from a self-referential table, with a format like:
Id Name ParentId
1 Item1 null
2 Item2 null
3 Item1.1 1
4 Item1.2 1
However, when I try to use this data, I get an error that "A parent item with key '1' could not be found". I am debugging and intercepting the data being returned in the GetDataAsync procedure, and can confirm that each item has a matching ParentId (or null).
It looks like the parent items have to appear before any child items in the list? This is pretty awkward, especially if we are going to be rearranging items within the tree.
Is there example code of how we're supposed to bind to this type of data. The file explorer demo is cool, but a good example of binding to a self-referential table with int keys would be more useful.
The text was updated successfully, but these errors were encountered:
Update: The code runs after sorting by ID, to ensure nothing references a parent which is later in the list, however, it only shows the parent items in the list on the page, with nothing happening when I click on them (and inspecting the HTML, it doesn't seem to be set to actually try and do anything when the nodes are clicked).
Are you loading each node as its expanded? If so please ensure LoadOnDemand is set to true. The latest library has seen some work to the PDTree component to allow greater drag and drop support. There are also now 3 demo pages for the component and the second demonstrates load on demand functionality.
I am trying to create a treeview from a self-referential table, with a format like:
However, when I try to use this data, I get an error that "A parent item with key '1' could not be found". I am debugging and intercepting the data being returned in the GetDataAsync procedure, and can confirm that each item has a matching ParentId (or null).
It looks like the parent items have to appear before any child items in the list? This is pretty awkward, especially if we are going to be rearranging items within the tree.
Is there example code of how we're supposed to bind to this type of data. The file explorer demo is cool, but a good example of binding to a self-referential table with int keys would be more useful.
The text was updated successfully, but these errors were encountered: