您好,有如下方式可供选择
- document.getElementById('btnItemsSource').addEventListener('click', function () {
- var node = theTree.selectedNode,
- arr = node.itemsSource;
- arr[node.index] = {
- header: 'updated itemData ' + Date.now(), items: [
- { header: 'first child' },
- { header: 'second child' },
- ]
- };
- node.refresh();
- });
- // re-load the whole tree
- document.getElementById('btnReload').addEventListener('click', function () {
- theTree.loadTree(true);
- });
复制代码 |