Note that there are some explanatory texts on larger screens.

plurals
  1. POKendo UI Delete a node attribute in Treeview
    text
    copied!<p>I have some nodes who contain the <code>items</code> value which seems to be initialized by default from Kendo with the value "[]" everytime!</p> <p>I want to completely delete the "items" field from the node but I can't seem to find any method for attribute deleting.</p> <p>I try to access the nodes through <code>dataItem</code> and I tried <code>dataItem.set("items",undefined)</code> but still I don't think it helped.I'm trying to delete the <code>items</code> field because there seems to be a problem with that initialization done by kendo and I can't append new nodes to them and I think it's because of it...</p> <p><strong>EDIT :</strong> </p> <p>It seems that <code>kendo.observableHierarchy(data)</code> initializes every tree node with no children (and therefore without an <code>items</code> attribute all).And by initializing I mean that everytime I show the dataSource the nodes that have no children have the <code>"items":[]</code> attribute added to them automatically!</p> <p>I tried appending nodes through <code>treeview.dataItem(treeview.select()).append()</code> but I found out that this method doesn't work on "old" nodes that have the <code>"items":[]</code> attribute added to them by kendo,so "old" nodes are all the nodes that have been loaded on the tree from page load and therefore were saved on the JSON file.</p> <p>And I say "old" because if I append a new node it doesn't have the <code>"items"</code> field and the <code>.append()</code> mentioned above works pretty fine on it adding a node and updating the dataSource..This <code>.append()</code> works pretty fine also on "old" nodes that already have children and so their <code>"items"</code> field is not modified by kendo because it already exists.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload