Option menu in datagrid

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Option menu in datagrid

Bob Sneidar via use-livecode
"...* table-style datagrid and each row includes an option menu *

*button"*


I assume you mean that your DG table has a column that contains an option
menu button (which, of course, appears in each row).

Edit the default column behavior of the column that contains the option
button.
Edit the FillinData handler to include something like

If conditionA then
set the text of button 1 of me to the text of field "OptionText1"
else
set the text of button 1 of me to the text of field "OptionText2"
end if

Don't forget to refresh the data grid.

Tested; works!

Regards,
Sri
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Option menu in datagrid

Bob Sneidar via use-livecode
Thanks Sri - I knew it had to be something simple!

Marty

> On Feb 11, 2020, at 9:26 AM, Sri via use-livecode <[hidden email]> wrote:
>
> "...* table-style datagrid and each row includes an option menu *
>
> *button"*
>
>
> I assume you mean that your DG table has a column that contains an option
> menu button (which, of course, appears in each row).
>
> Edit the default column behavior of the column that contains the option
> button.
> Edit the FillinData handler to include something like
>
> If conditionA then
> set the text of button 1 of me to the text of field "OptionText1"
> else
> set the text of button 1 of me to the text of field "OptionText2"
> end if
>
> Don't forget to refresh the data grid.
>
> Tested; works!
>
> Regards,
> Sri

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Option menu in datagrid

Bob Sneidar via use-livecode
You can also set the text of the button in a mouseDown handler in the button itself. This works well if you have more than one option menu and the options in one of them depends on the selections the user has made in another. The script will be similar to the one provided by Sri.

Regards
Tore Nilsen

> 11. feb. 2020 kl. 19:15 skrev Marty Knapp via use-livecode <[hidden email]>:
>
> Thanks Sri - I knew it had to be something simple!
>
> Marty
>
>> On Feb 11, 2020, at 9:26 AM, Sri via use-livecode <[hidden email]> wrote:
>>
>> "...* table-style datagrid and each row includes an option menu *
>>
>> *button"*
>>
>>
>> I assume you mean that your DG table has a column that contains an option
>> menu button (which, of course, appears in each row).
>>
>> Edit the default column behavior of the column that contains the option
>> button.
>> Edit the FillinData handler to include something like
>>
>> If conditionA then
>> set the text of button 1 of me to the text of field "OptionText1"
>> else
>> set the text of button 1 of me to the text of field "OptionText2"
>> end if
>>
>> Don't forget to refresh the data grid.
>>
>> Tested; works!
>>
>> Regards,
>> Sri
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode