UA-17470720-3

Jump to content


Photo
- - - - -

SCSelectionCell for tiered selection (ie Country, State, City)

data-definitions models actions

  • Please log in to reply
1 reply to this topic

#1 rolfenstein

rolfenstein

    Jr. Member

  • STV 4.0 Pro
  • PipPip
  • 16 posts
Reputation: 1
Good

Posted 27 May 2014 - 10:45 AM

I want to have a selection cell where clicking one option will open another selection table until final selection, which will return selection. For example one would click a location selection cell which will click "USA", then "CA" then "Los Angeles" to return Los Angeles.

 

Can STV support this? Right now mine will only accept an NSArray. How to define SCSelectionCell?

 

I was thinking to build off an NSDictionary from the following JSON (not sure my JSON is formatted correctly for NSDictionary), where one might click "USA" then "Washington DC" or "USA" then "California" then "Los Angeles" for example.

 

{
"USA": [
   "Washington DC": {"Name":"Washington DC", "parent":"USA","code":"111"},

   "California":[
      "Los Angeles":{"Name":"Los Angeles", "parent":"USA","code":"112"}
      "San Diego":{"Name":"San Diego", "parent":"USA","code":"113"}
   ]
]
"Mexico": [
]
}


Edited by rolfenstein, 27 May 2014 - 02:03 PM.


#2 Dave Guerin

Dave Guerin

    Forum Master

  • STV 5.0 Pro
  • PipPipPipPipPipPipPip
  • 539 posts
  • LocationIreland
Reputation: 134
Popular

Posted 28 May 2014 - 08:31 AM

Hi rolfenstein,

 

The only bit that's going to be a selection is the ""Los Angeles" bit, the rest are going to be normal drill down aren't they? So an NSArray of Countries, drilling down to NSArray of States, drilling down to a SCSelectionCell of Cities.

 

You could have 3 SCSelectionCell, one for Countries, one for States, one for Cities, one above the other, and selecting Countries determines the items NSArray that the States SCSelectionCell uses, but that'd be (a bit) more complicated.


Cheers,

Dave

www.dgapps.ie





Also tagged with one or more of these keywords: data-definitions, models, actions

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users