Datagrid on select row (with keyboard or mouse)

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
ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Datagrid on select row (with keyboard or mouse)

Post by ghettocottage » Mon Dec 05, 2016 4:02 am

In a datagrid, is it possible to do something when a row is selected, whether it is selected with keyboard or mouse?

For example, I have a "on mouseUp" action which populates some fields when you click on a row in the datagrid; however, what if someone is scrolling through the datagrid with keyboard keys?

Can I make that action happen on selectRow..

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Datagrid on select row (with keyboard or mouse)

Post by MaxV » Mon Dec 05, 2016 12:57 pm

There are the following messages:
  • selectionChanged
  • EditValue
  • CloseFieldEditor
Read here: http://livecode.wikia.com/wiki/Datagrid_API
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Re: Datagrid on select row (with keyboard or mouse)

Post by ghettocottage » Sat Dec 10, 2016 5:00 pm

Thanks, this did the trick:

Code: Select all

on selectionChanged
  theThingIwantToHappen
end selectionChanged

I really enjoy how simple the answers are when working in Livecode.

Post Reply