Cascading Menus

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
bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Cascading Menus

Post by bbhank » Sat Mar 26, 2016 9:27 pm

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Cascading Menus

Post by dunbarx » Sun Mar 27, 2016 1:23 am

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

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: Cascading Menus

Post by bbhank » Mon Mar 28, 2016 4:35 pm

If I can help it. Not relative to anyone's work status.
I will look into those.
:P
Thank you.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Cascading Menus

Post by dunbarx » Mon Mar 28, 2016 5:04 pm

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
Last edited by dunbarx on Mon Mar 28, 2016 6:25 pm, edited 1 time in total.

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: Cascading Menus

Post by bbhank » Mon Mar 28, 2016 5:11 pm

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.

bbhank
Posts: 116
Joined: Thu Mar 17, 2016 6:04 pm

Re: Cascading Menus

Post by bbhank » Thu Mar 31, 2016 7:34 am

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.
:)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”