the dragdestination wierdness
Bob Sneidar
bobs at twft.com
Fri Jan 8 20:31:49 EST 2010
Hi Trevor.
That throws an error. The DragDestination returns the long id of the INSTANCE of the template, or so it seems to me. Only the last column is returning the long id of the TEMPLATE field itself. In no case do any of the returned fields have the property dgColumn.
I can get the dgColumn of the target, but that does not return the actual row I dropped on, but only the column itself. I tried to get the dgRow of the target, but of course that didn't work because the target is a column.
I am going to have to play around some more. I am not sure I am getting this. Thanks for the reply. BTW here is my code:
on dragStart
put the dgDataControl of the target into theDataControl
## Watch out for dragging on the header
if theDataControl is empty then pass dragStart
## Get Data Grid index of control that was clicked on
put the dgDataControl of the target into theTargetLongID
put the dgIndex of the dgDataControl of the target into theIndex
## Tell Data Grid to set the dragImage to the row
## that theIndex is associated with
set the dgDragImageIndex of me to theIndex
## Set the dragData["private"] so that drag operation
## begins
set the dragData["private"] to the short name of theDataControl
set the dgTrackDragReorder[theIndex] of me to true
put theIndex & return & the dragData["private"]
end dragStart
on DragDrop
put the dragDestination into theDestination
put dragData["private"] & return & the short name of theDestination & return & the dgColumn of the target
end DragDrop
When I drag from column 1 to column 1 on a different row I get this:
PriFields 0001
PriFields 0002
PriFields
When I drag from any column to the LAST row I get this:
PriFields 0001
_ColumnData_
SecFields
On Jan 8, 2010, at 5:12 PM, Trevor DeVore wrote:
> _ColumnData_ is the name of the field. You want to access the custom props of the cell. Try checking the dgColumn of the dragDestination.
More information about the use-livecode
mailing list