Detecting a selection being made on a Data Grid.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Locked
Quentin Brown
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 14
Joined: Wed Apr 17, 2013 11:15 pm

Detecting a selection being made on a Data Grid.

Post by Quentin Brown » Wed Aug 28, 2013 5:50 pm

I have come upon a tutorial which mentions using the dgHilitedLines property to find out which line in a Data Grid is selected but it does not make it clear where you might put this script to detect it (Data Grids seem to have so many elements to them : substacks and the custom control with nearly 9000 lines of script attached) Would it simply be a mouseup call on this custom control item that represents the Data Grid on your card? Aren't there already lots more mousup calls in that script already?

I basically want to have a media player object on my card update to play the video media associated with a particular line in the Data Grid when that line is selected. Each line in the Datagrid will represent a single video clip and information about it, including a thumbnail and full path to the media file. When any line is selected I want the player object to capture that selection and then load in the associated media file for that line in the Data Grid. It would be great as well if when multiple lines are selected it would display each clicked on clip as selections are made - updating to the latest addition to the selection each time.

I hope you can provide some explanations of the principles and logic behind how this is achieved along the way too.

Many thanks,

Quentin.
Last edited by Quentin Brown on Tue Sep 03, 2013 11:12 pm, edited 1 time in total.

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Detecting a selection being made on a Data Grid.

Post by bangkok » Wed Aug 28, 2013 8:41 pm

Stack with different examples to do that :

http://forums.runrev.com/viewtopic.php? ... 540#p78299

(a script in the grid, a script outside the grid)

Locked

Return to “Summer School 2013”