Hi,
Below is code that show how I draw swimlane . I am getting error when I update nodes property.
[Vue warn]: Error in callback for watcher "nodes": "TypeError: swimLaneNode is undefined" found in ---> <DiagramComponent> <ElCol> <ElContainer> at packages/container/src/main.vue <ElRow> <ElContainer> at packages/container/src/main.vue... (1 recursive calls) <WorkFlowsEdit> at src/views/workflows/pages/edit.vue <AppMain> at src/layout/components/AppMain.vue <Layout> at src/layout/index.vue <App> at src/App.vue <Root>
Hi Sivakumar,
I tried your sample, Its rendering fine. To implement my requirement I added a button which should update the "nodes" property but It seems like not working. In below example, It should remove a node with text "Consumer learns \n of product" but its not. See below code and screenshot after click.
onUpdate(){
diagram.remove(diagram.getObject(this.nodes[0].shape.lanes[0].children[0].id));
} |
Hi Sivakumar, Thanks for you help.
Requirement is not just limited to delete. We also want to make some updates in nodes. As you suggesting to use diagram instance, It will be an extra overhead where we will be required to maintain diagram instance along with properties bind to it which I have been doing for last couple of months but now Its getting more complicated and problematic.
Is their any correct where we just do update in nodes properties and diagram observe & apply those changes ?
Thanks !
Here is git repository with minimal issue reproduce.
Hi Ashish,
On analyzing the provided query, we suspect that you need to modify the nodes that are present in the swimlane dynamically. By default, in the diagram, we can able to modify the node’s properties after getting that node from the diagram instance. We cannot able to directly access the node from its collection and modify it. By using the getObject public API method, we can able to get the node from the diagram. Without using the diagram instance we cannot able to change node appearance. This is the default behavior of the diagram control. So please use the getObject method to get the node from the diagram and modify its appearance/position/size. Please refer to the code snippet for how to get a node from the diagram and change its color
var node = diagram.getObject(‘node1’); node.style.fill = “red”; |
Regards
Aravind Ravi