Hi, I'm trying to create a table that I can drag nodes on and off. It needs to act like a raft, so that if I have items on top of the table, they move with it. But if I drag an item out it behaves independently again.
Here is a video of what I am trying to do and the issues I am having.
The biggest issues I am having are:
Here is a stackblitz of what I have so far
And a video
Maybe there is a much simpler way for me to create this kind of component? In some ways it is similar to the SwimLane shape. Is there a better way to create complex shapes like this?
Many thanks! Geoff
Hi, I made a bit of progress with issue 1(one) by using the mouseUp event rather than the position change event. I updated the stackblitz
|
On the further analysis of the shared sample, we suggest you use the AllowDrop constraints to node and use the drop event instead of position change event. If we enable the AllowDrop constraints to a node and drag and drop a node over other node means, the drop event will be trigger, in that event we can call addOrRemoveNodeFromTable method. We have added the suggested change in the sample and added below for your references. Sample link: https://stackblitz.com/edit/angular-przr62?file=src%2Fapp%2Fdata.ts |
|
Once I have added the dragged nodes as children of the table, they don't behave quite right:
|
We will check and update the further details on July 15, 2021. We appreciate your patience until then. |
Hi Arun, thanks very much for that response.
I was using drop originally, but it wasn't working when I was dropping nodes on top of nodes. Seems to work OK since I just use the window mouseUp. Note: I think that's why your stackblitz works :-).
This is still there, triggered:
Anyhow, I'm fine with using the mouseUp event for now. Seems to work pretty well.
|
Once I have added the dragged nodes as children of the table, they don't behave quite right:
|
On further analyses of the shared sample, we found that you have called addgroupToChild API in mouseUp event. The mouseUp triggers every time while you perform mouseUp action in the diagram it repeatedly calls addgroupToChild API every single time when you perform mouse action that is causing the reported issue. So, we suggest you add the following code snippet to avoid the repetitive call of API in mouseUP event. We have added the suggested change in the sample and added it below for your reference and video link.
Code snippet:
|
Hi Arun, thanks very much 🙏, that was a great help in solving the issue, I had to do it slightly differently to allow notes to be dragged off and between sections of the table.
I think we will be able to make this work for our use case! The outstanding issues I'm having, in the order I care about them...(please see video)
---------
Stackblitz link: https://stackblitz.com/edit/angular-cmqmxe?file=src/app/data.ts
Video link: https://drive.google.com/file/d/1BgKh1Pm73IAbcP8kBPtkTL5wcp1WaEPU/view?usp=sharing
|
Query |
Response | |
|
If I drag to select or do a select-all the children don't move in line with the table
|
We suggest you use the following code to avoid the children do not move along with the table. We set the true for the selection change event cancel argument as true and cancel the selection and add the selection to parent table alone by using the select API.
Code snippet:
| |
|
Is it possible to allow user interaction with multiple of the children (notes)
|
We understood that you want to multi select the children by using the “shift+ mouse Click”. When we click on the child node in the group the parent node will select the first click and at the second click the child node will get selected. It’s the default selection behavior of the group nodes. But we change the default behaviors using the key events, selection change events and click events. please find the below code snipper for your references.
Code snippet:
| |
|
Is it possible to prevent the children (notes) resizing with the parent?
|
We can able to replicate the reported issue at our end we are validating the issue and update you with more details on 19th July 2021. |
|
Query |
Response |
|
Is it possible to prevent the children (notes) resizing with the parent? |
On the further analysis of the shared details, we understood you want to restrict the children scaling with respect to the parent group node is resizing. It's the implementational behavior of the group nodes. The inner children size changes with respect to the group resize. The group is a container of the children, the size of the group node is determined by the children's sizes. So, while resize the group the children get resize and while resize the child the group container gets resize. It’s the behavior of the group in diagram we don’t have any option to change this implementational behavior.
|
Thanks very much @Gowtham, that was a great help
Hi Geoff,
Thanks for your update. Please let us know whether you need any further assistance on this.
Regards
Gowtham