Merge pull request #5485 from vvlladd28/improvement/nav-tree/updated-node
[3.3.2] UI Improvement: added argument updatedData in function updateNode in …
This commit is contained in:
commit
f22c421acd
@ -42,7 +42,7 @@ export interface NavTreeEditCallbacks {
|
||||
nodeIsOpen?: (id: string) => boolean;
|
||||
nodeIsLoaded?: (id: string) => boolean;
|
||||
refreshNode?: (id: string) => void;
|
||||
updateNode?: (id: string, newName: string) => void;
|
||||
updateNode?: (id: string, newName: string, updatedData?: any) => void;
|
||||
createNode?: (parentId: string, node: NavTreeNode, pos: number | string) => void;
|
||||
deleteNode?: (id: string) => void;
|
||||
disableNode?: (id: string) => void;
|
||||
@ -221,11 +221,14 @@ export class NavTreeComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
};
|
||||
this.editCallbacks.updateNode = (id, newName) => {
|
||||
this.editCallbacks.updateNode = (id, newName, updatedData) => {
|
||||
const node: NavTreeNode = this.treeElement.jstree('get_node', id);
|
||||
if (node) {
|
||||
this.treeElement.jstree('rename_node', node, newName);
|
||||
}
|
||||
if (updatedData && node.data) {
|
||||
Object.assign(node.data, updatedData);
|
||||
}
|
||||
};
|
||||
this.editCallbacks.createNode = (parentId, node, pos) => {
|
||||
const parentNode: NavTreeNode = this.treeElement.jstree('get_node', parentId);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user