Discussion Forums  >  Uncategorized

Replies: 3    Views: 1467




Posts:
Reg:
location not...

02/10/12 09:57 AM (12 years ago)

JSON and dynamic menu

Hi, First thanks for a truly amazing piece of work, making app development far easier. I've setup BT Server 2.0 and am working on a dynamic store locator type app. Managed to get links to MySQL/PHP working for data retrieval, mapping etc. Now I'm trying to create a menu list of all stores, when you tap a menu item, want to show store details. I've managed to build the menu list with JSON and all works good. Now trying to add detail screen for each menu item and I'm stumped. I'm generating the JSON data from my php script. My thinking was to populate loadScreenWithItemId element with unique id's for each store. Then create BT_screen_customURL items using those unique id's, with the URL pointing to another php script (passing screenId), used to create the store details page. Whenever I try to create the required JSON for this, the app hits a parse error even though the JSON validates at JSONLint.com. I'm sure this is something to do with not supplying the JSON data in the required format but I can't figure it out. Or perhaps it's not possible to build the JSON data for multiple screens at the same time?. Any advise/pointers much appreciated. Current data looks like this. [{itemId:StoreListMenu,itemType:BT_screen_menuListSimple,itemNickname:Locations,navBarTitleText:Tollden Farms Retailers,navBarBackgroundColor:#4CA55E,navBarStyle:solid,hideBottomTabBarWhenScreenLoads:1,listBackgroundColor:#EE9600,listRowBackgroundColor:#FFFFFF,listStyle:round,listRowSelectionStyle:gray,hideFromSearch:1,childItems:[{itemId:StoreList1,itemType:BT_menuItem,loadScreenWithItemId:StoreDetail1,titleText:4 Paw Express,rowAccessoryType:none,transitionType:flip},{itemId:StoreList2,itemType:BT_menuItem,loadScreenWithItemId:StoreDetail2,titleText:4 Paws Pet Lodge,rowAccessoryType:none,transitionType:flip}]},{itemId:StoreDetail1,itemType:BT_screen_customURL,itemNickname:StoreDetail1,dataURL:http:\/\/www.tolldenfarms.ca\/store_details.php?screenId=[screenId],navBarTitleText:4 Paw Express - Details},{itemId:StoreDetail2,itemType:BT_screen_customURL,itemNickname:StoreDetail2,dataURL:http:\/\/www.tolldenfarms.ca\/store_details.php?screenId=[screenId],navBarTitleText:4 Paws Pet Lodge - Details}] Thanks.
 
muhromatic
buzztouch Evangelist
Profile
Posts: 24
Reg: Dec 19, 2011
NYC
240
like
02/10/12 02:50 PM (12 years ago)
Hello: I have been working on similar/same functionality... email me a textfile of the php ( muhromatic(at)muhromatic(dot)com ) and I will see what we can find/do to get you up and running. GM
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
02/10/12 03:38 PM (12 years ago)
Subscribe, just following.
 
vmurphy
Aspiring developer
Profile
Posts: 6
Reg: Jan 09, 2012
Ottawa
60
like
02/13/12 02:22 PM (12 years ago)
Problem solved. The thing which help me out was that, when building the BT_menuItem list, I had assumed my only option was loadScreenWithItemId, until I discovered loadScreenObject. Using this, I was able to construct another JSON object for my menu item details screen and load my entire menu structure successfully.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.