Dynamic List Buttons for mobile

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mahendra
Posts: 3
Joined: Mon Jun 22, 2015 7:45 pm

Dynamic List Buttons for mobile

Post by mahendra » Tue Jul 14, 2015 2:20 pm

Hi

I am building a mobile app and I have a number of items returned from a DB. Lets call them slots. I want to create a mobile friendly list of Buttons for each slot dynamically.

How can I do this is there an example stack as I want this to look like a list of buttons the end user can select and grey out ones they can't for whatever reason.

Thanks
Anil

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Dynamic List Buttons for mobile

Post by dunbarx » Tue Jul 14, 2015 2:59 pm

If you are creating buttons on the fly, based on, say, the number of "slots" required at any time, then you will want to read up on the "templateButton" in the dictionary. This virtual object allows you to set the properties of any newly created button without having to clone an existing one.

If that matters...

So then if you have already cleaned up any old buttons, and know, say, that you need ten more, you can create ten new buttons, name them appropriately in turn so you can identify them later for deletion, and you are in business.

Greying out a button means to set its "enabled" property to "false".

I suspect there is more that you are asking for...

Craig Newman

Post Reply