Page 1 of 1

Datagrid on select row (with keyboard or mouse)

Posted: Mon Dec 05, 2016 4:02 am
by ghettocottage
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..

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

Posted: Mon Dec 05, 2016 12:57 pm
by MaxV
There are the following messages:
  • selectionChanged
  • EditValue
  • CloseFieldEditor
Read here: http://livecode.wikia.com/wiki/Datagrid_API

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

Posted: Sat Dec 10, 2016 5:00 pm
by ghettocottage
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.