DataGrid/Drag and Drop
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
DataGrid/Drag and Drop
I have not yet tried programming any drag and drop operations so hoping to get some guidance before starting down that path.
Specifically, is it possible to drag and drop a line in a datagrid onto a line in a different datagrid?
I'm hoping to implement something like the way the Mac Address Book lets you move a person into a group by simply dragging that person's name over the group name.
Thanks,
Pete
Specifically, is it possible to drag and drop a line in a datagrid onto a line in a different datagrid?
I'm hoping to implement something like the way the Mac Address Book lets you move a person into a group by simply dragging that person's name over the group name.
Thanks,
Pete
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Yes you can. The sample application from my presentation at RunRevLive has an example of this.
http://tr.im/data_grid
Look at the download and manual under the "Presenting Data with the Data Grid" section on the above page for example code and instructions.
http://tr.im/data_grid
Look at the download and manual under the "Presenting Data with the Data Grid" section on the above page for example code and instructions.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Ok, I have all this working just like I want it to except for one thing I don't understand and one question.
The dragStart code contains a reference the dgDragImageIndex property but I can't find any reference to that property in the Datagrid Manual.
I'm concerned that there isn't any visual feedback to the user while the drag/drop operation is going on until the mouse is over the destination. I was hoping that there would be a way of showing things more visually. If you're familiar with the Mac Address Book, when you start to drag a name in the list, a small icon appears that follows the mouse and when the mouse is over an entry in the Group list, the image changes slightly to include a plus sign to indicate that the person will be added to that group.
Doesn't have to necessarily be as sophisticated as that, just some way of indicating that something is being dragged before the mouse lands on the destination.
Thanks,
Pete
The dragStart code contains a reference the dgDragImageIndex property but I can't find any reference to that property in the Datagrid Manual.
I'm concerned that there isn't any visual feedback to the user while the drag/drop operation is going on until the mouse is over the destination. I was hoping that there would be a way of showing things more visually. If you're familiar with the Mac Address Book, when you start to drag a name in the list, a small icon appears that follows the mouse and when the mouse is over an entry in the Group list, the image changes slightly to include a plus sign to indicate that the person will be added to that group.
Doesn't have to necessarily be as sophisticated as that, just some way of indicating that something is being dragged before the mouse lands on the destination.
Thanks,
Pete
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
There is an updated version of the Data Grid library on that same page I sent you to. There should be instructions for installing it as well. After installing it the dgDragImageIndex will magically set the dragImage to a snapshot of the row you are dragging. This should provide some good visual feedback for you.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Not yet. The new library isn't really an official release and I haven't gotten around to documenting the new features yet or picking out the relevant entries for the change log.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder