DragDrop and the DragDestination

zryip theSlug zryip.theslug at gmail.com
Tue Jan 18 18:50:55 EST 2011


On Wed, Jan 19, 2011 at 12:25 AM, Bob Sneidar <bobs at twft.com> wrote:
> Well this is odd...
>
> I am dragging from one datagrid to another.
>
> In the script of the destination datagrid, I have a DragDrop handler. In that script I put the dragDestination into a variable, then put the variable into the message box. This is what I get:
>
> graphic id 80637 of group id 80636 of group id 80631 of card id 80619 of stack "/Users/bobsneidar/Documents/LiveCode Stacks/Logos Help Desk.rev"
>
> Why in the WORLD would I be getting a graphic ID?? I should mention that the datagrid is empty, so hmmm is it because there is no actual field that I am dropping onto? That is really weird then, because that would mean I can never drop data onto an empty datagrid and get the row and column I dropped data on to.

Hi Bob,

You're right, a datagrid is built on the fly (especially when is cache
control property is set to false), so when there is no data, there is
no field in the datagrid.

You could add a test like this one for adding data when a datagrid is empty:

if (the dgDataControl of the target is empty) then
   add an empty line
   copy the data
end if

And have a look to the experiment 19, if you missed it:
http://www.aslugontheroad.co.cc/index.php?option=com_phocadownload&view=category&download=19:experiment-19-drag-drop-in-dg-replacing-a-value-in-a-column&id=7:data-grid&Itemid=63


Best regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc




More information about the use-livecode mailing list