emaender
01-02-2004, 01:43 PM
Hello!
I've studied the Amazon and Calendar sample applications, and I have a question regarding drag and drop functionality.
I'm working on an application where we will need to drag and drap components onto a design sheet. Picture a "drawing" application, where the user will be dragging a number of images onto a design canvas, then moving the images around. In addition, images may be dragged onto another image, and in this case they will need to be contained INSIDE that image. In other words, the image will now have a new parent, no longer the canvas, but the image it was dragged into.
I was able to create a simple example using datasets, where an image could be dragged into another, and a record would be added to a dataset therefore replicating the image within the parent image. However, we anticipate on the order of 100 images or more in our application. In that case, each image would need 100 different datasets all used to replicate images that may be dragged in, etc. I'm hoping there may be a more elegant approach to this problem.
The core of my question is, is there a way to "reassign" an object (say, for example, a view) to another parent? I've figured out that this.deleteNode() gives me the capability to remove the image from wherever I'm pulling it, but I haven't figured out a way to make it a child of another object, outside of the dataset approach. Any ideas?
Thanks in advance for your help with this!
I've studied the Amazon and Calendar sample applications, and I have a question regarding drag and drop functionality.
I'm working on an application where we will need to drag and drap components onto a design sheet. Picture a "drawing" application, where the user will be dragging a number of images onto a design canvas, then moving the images around. In addition, images may be dragged onto another image, and in this case they will need to be contained INSIDE that image. In other words, the image will now have a new parent, no longer the canvas, but the image it was dragged into.
I was able to create a simple example using datasets, where an image could be dragged into another, and a record would be added to a dataset therefore replicating the image within the parent image. However, we anticipate on the order of 100 images or more in our application. In that case, each image would need 100 different datasets all used to replicate images that may be dragged in, etc. I'm hoping there may be a more elegant approach to this problem.
The core of my question is, is there a way to "reassign" an object (say, for example, a view) to another parent? I've figured out that this.deleteNode() gives me the capability to remove the image from wherever I'm pulling it, but I haven't figured out a way to make it a child of another object, outside of the dataset approach. Any ideas?
Thanks in advance for your help with this!