Page 1 of 1

Cascading Menus

Posted: Sat Mar 26, 2016 9:27 pm
by bbhank
How does one get pull down menu button to populate from database (MySQL) and have those items be able to be selected as menu items, then send that selection to the next button, and the next button.The button sequence is State->City->Facilities List->List of events at that facility in DataGrid.

Succinct answers with code only.

Re: Cascading Menus

Posted: Sun Mar 27, 2016 1:23 am
by dunbarx
Hi.
Succinct answers with code only.
What, you will not read any other form of reply? The helpers here are all volunteers, you see.

Anyway.

However you read data from any source, all four styles of menu-like buttons use tabs within the contents of the button to format menuItems and subMenuItems. Do you know about this, especially that buttons are containers, though this may not be obvious? If not, please read about it in the user guide. I also recommend that you create a button and play with it. Start off by placing something like this in it:

Code: Select all

Choice 1
Choice 2
[tab] SubChoice 1
[tab]subChoice 2
[tab][tab] subSubChoice 1
[tab][tab] subSubChoice 2
Choice 3
That sort of thing. I assume you are familiar with such things as the "menuHistory" and the "selectedText"? In other words, try this in the button script:

Code: Select all

on menuPick pItemName
      put pItemName && the selectedText of me && the menuHistory of me && the label of me into fld 1
end menuPick
Is this of some help?

Craig Newman

Re: Cascading Menus

Posted: Mon Mar 28, 2016 4:35 pm
by bbhank
If I can help it. Not relative to anyone's work status.
I will look into those.
:P
Thank you.

Re: Cascading Menus

Posted: Mon Mar 28, 2016 5:04 pm
by dunbarx
Good luck. Write back with your findings.

Note that even though I placed that menuItem list in a code tagged section, I meant that the contents of the button was to be set to that text.


Craig

Re: Cascading Menus

Posted: Mon Mar 28, 2016 5:11 pm
by bbhank
Will do.
What I'm building is hopefully probably something a lot of folks might be able to use, a state, city, facility, pulldown menu using database selected items. I see lots of them around. I have one that works in php.


Any input appreciated.

Re: Cascading Menus

Posted: Thu Mar 31, 2016 7:34 am
by bbhank
Instead of reinventing the wheel I used a static list of the 50 states. Then used that choice to query the database. Putting that result into DataGrid was next. I decided not drill down any further, in displaying the data by city instead of state. Problem solved.
Thanks.
:)