On selecting a row in a DG table.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
CAsba
Posts: 364
Joined: Fri Sep 30, 2022 12:11 pm

On selecting a row in a DG table.

Post by CAsba » Wed Oct 25, 2023 1:07 pm

Hi,
In my current interface, the user is asked to select a customer - a row in the DG, the click on button "Continue".
Is it possible that user clicks on line and this action invokes the button "Continue", (so the button doesn't even have to be visible).
Something like...On Selection in the DG handler ???

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: On selecting a row in a DG table.

Post by Klaus » Wed Oct 25, 2023 1:21 pm

Hi CAsba,

put this into the script of your datagrid group (NOT into any behaviour!)

Code: Select all

on selectionChanged pHilitedIndexes, pPreviouslyHilitedIndexes
  ## add your button code here...
end selectionChanged
Now everytime the user click on a row, the code will be executed.


Best

Klaus

CAsba
Posts: 364
Joined: Fri Sep 30, 2022 12:11 pm

Re: On selecting a row in a DG table.

Post by CAsba » Wed Oct 25, 2023 2:02 pm

Klaus, Thanks for that. It works wonderfully. How do you know such rare gems ?

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: On selecting a row in a DG table.

Post by Klaus » Wed Oct 25, 2023 2:28 pm

I always sleep with the complete LC docs under my pillow! :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9670
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: On selecting a row in a DG table.

Post by dunbarx » Wed Oct 25, 2023 3:14 pm

I sleep with the "Complete Works of Klaus" under mine. Still waiting for enlightenment...

Craig

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: On selecting a row in a DG table.

Post by Klaus » Wed Oct 25, 2023 3:58 pm

:lol: :lol: :lol:

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: On selecting a row in a DG table.

Post by Klaus » Thu Oct 26, 2023 8:29 am

OK, I am using LC and its ancestors (Metacard, Runtime Revolution, Revolution) since 1999
and have a very good memory, that's my secret. :-)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”