clickability in a DataGrid

Robert Sneidar slylabs13 at me.com
Wed Jan 23 16:40:02 EST 2013


What if the selection is not changing?

On Jan 22, 2013, at 8:19 PM, Peter Haworth wrote:

> Yep, in the group script. You could probably do it in a selectionChanged
> handler as well.
> Pete
> On Tuesday, January 22, 2013,  <dunbarx at aol.com> wrote:
>> Peter.
>> 
>> 
>> Those are the row and column properties I meant. But I do not understand
> why you cannot get what I got with the mouseUp handler. It is the very
> first thing I ever did with a dataGrid, before I learned some of the other
> functionalities.
>> 
>> 
>> With that handler,I get something like: field "Col 1 0001"
>> 
>> 
>> which can be easily broken out as required. The handler is in the group
> script, right?
>> 
>> 
>> Craig
>> 
>> 
>> 
>> 
>> 
>> -----Original Message-----
>> From: Peter Haworth <pete at lcsql.com>
>> To: How to use LiveCode <use-livecode at lists.runrev.com>
>> Sent: Tue, Jan 22, 2013 9:56 pm
>> Subject: Re: clickability in a DataGrid
>> 
>> 
>> Hi Craig,
>> I tried your mouseUp Script and all I got was a reference to graphic
>> "dgalternatingrows" no matter which row or column I click in.
>> 
>> The EditFieldText trap would work but he'd have to double click the cell
>> and I don't think that's what he had in mind.
>> 
>> However, I think this seems to work as a scrip of the datagrid group
>> (apologies if this ends up with asterisks all over it):
>> 
>> *on* mouseUp pMouseBtnNum
>> 
>>      *if* pMouseBtnNum is 1 *then*
>> 
>>      *put* the dgColumn of the target,the dghilitedline of me
>> 
>>   *end* *if*
>> 
>> *end* mouseUp
>> lcSQL Software <http://www.lcsql.com>
>> 
>> 
>> On Tue, Jan 22, 2013 at 5:55 PM, <dunbarx at aol.com> wrote:
>> 
>>> Hi.
>>> 
>>> 
>>> There are a few ways to do this. The old fashioned way is to write in the
>>> group script:
>>> 
>>> 
>>> on mouseUp
>>>  put the target
>>> end mouseUp
>>> 
>>> 
>>> You get a result that is easily deconstructed to row and column
> references.
>>> 
>>> 
>>> You can also trap the "editFieldText" message, or any of the row and
>>> column properties.
>>> 
>>> 
>>> Craig Newman
>>> 
>>> 
>>> 
>>> -----Original Message-----
>>> From: Peter Haworth <pete at lcsql.com>
>>> To: How to use LiveCode <use-livecode at lists.runrev.com>
>>> Sent: Tue, Jan 22, 2013 7:44 pm
>>> Subject: Re: clickability in a DataGrid
>>> 
>>> 
>>> Hi Sieg,
>>> I can't think of a way to detect a click in a specific cell of a
> datagrid.
>>> 
>>> If nobody else can come up with something, a couple of alternatives would
>>> be to customize your Edit and Delete columns to contain buttons and put
>>> your delete/edit commands in the mouseUp handler for each button, or
>>> implement a right click popup menu with delete/edit options on it and put
>>> the logic in the menuPick handler for the popup.
>>> 
>>> Would take too much space to describe how to do those things, but check
> out
>>> the datagrid manual for details.
>>> 
>>> Pete
>>> lcSQL Software <http://www.lcsql.com>
>>> 
>>> 
>>> On Tue, Jan 22, 2013 at 4:09 PM, Sieg Lindstrom <sl at trackandfieldnews.com
>>>> wrote:
>>> 
>>>> I've used LiveCode/RunRev for some time but an new to using DataGrids.
>>>> 
>>>> What I'd like to do (for Mac/Windows users) is include a DataGrid
>>>> configured as, say, four columns of data followed by two columns that
> are
>>>> the same in each row: one that reads "Delete" and one that reads
> "Edit."
>>>> I'd like to set it up so that if the user clicks on "Delete" or "Edit"
>>> in a
>>>> given row that then triggers handlers to either delete that row or edit
>>> the
>>>> data contained in the other four columns of that row of the grid.
>>>> 
>>>> Using a standard text field with tab-delimited data in each row, I'd
> use
>>>> the ClickText and the ClickLine in the field script to determine what
> the
>>>> user clicked and trigger the appropriate actions. How would one achieve
>>>> this in a DataGrid?
>>>> 
>>>> Thanks in advance!
>>>> 
>>>> Sieg Lindstrom
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription
>>> preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>> 
>> _______________________________________________
>> use-livecode mailing list
>> 
> 
> -- 
> Pete
> lcSQL Software <http://www.lcsql.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list