1 person found this helpful
yes, but you're not really going to drag and drop a row from one datagrid to another. you just make it look like you're dragging and dropping a row by attaching a movieclip (with the datagrid row content) and having it drag with the mouse and if released over a dropenabled datagrid, add the item to the 2nd datagrid.
and to really make it look more like a drag and drop, the item should be removed from the first datagrid.
So you make a movieclip representing what's in the row, attach the actual data to the movieclip, and when you drop it, the attached data populates the row?
Do you know of any tutorials that show this, or parts of what is required?
1 person found this helpful
well, you'd make one movieclip that contains dynamic textfields so you can add the dragged rows data to the textfields' text properties.
and i don't know of any tutorials for this. using google is the best way i've found to find tutorials. but this is such a narrow task i doubt you'll be successful finding a tutorial.
on the other hand, this is pretty easy if you break it up into a few steps:
1. create a movieclip (with a linkage id (as2) or class (as3) that contains as many dynamic textfields as columns in your dragged datagrid. and now that i'm typing this, i can see that this step could be supplanted by dynamically creating a movieclip and adding textfields to it. that way if you had several datagrids with varying number of columns you wouldn't be restricted or stuck making several movieclips,
2. retrieve the data from the clicked row of the datagrid.
3. apply the data to the text property of your textfields.
4. drag this movieclip until a mouseup is detected.
5. on mouseup drop the movieclip. if it's over a drop-enabled datagrid, add the data to this datagrid and possibly remove the data from the drag-enabled datagrid and remove the movieclip.
So the datagrid I'm dragging to doesn't have movieclips in it - it justs accepts the textfield data from the dragged clip?
I'm thinking that I will also need to be able to
a) reorder the data (in the target grid, using drag and drop)
b) select multiple rows in the target grid for copying to other parts of it or reordering.
Is this possible in Flash CS4 or 5, or is it a Flex job?
Thanks for the insight kglad
the datagrid has not textfields. the textfields are added to a parent movieclip so it "appears" that you're dragging a row of the datagrid.
a) i'm not sure "reordering" is the correct work. you'll be adding data (to the drop-target datagrid) and possibly removing data from the drag datagrid.
b) if you want to drag and drop more than one datagrid row, that can be done.
this can be done with any version of flash that supports the datagrid including older versions of flash and as2.
Ahh - by reorder, I mean that once the data has been dargged to the target dataGrid, I want the ability to drag rows up and down at will. So Say I drag data in between row 5 and 6 - a new row 6 appears, and then if I want to, I could drag row 6 up in between row 2 and 3, and the old row 6 now becomes the new row 3.
you'll need to encode that.