I just got started with CanJS, read through the tutorials but am stuck when trying to get the following HTML.
<div class="location"><h1>Location 1</h1>
<div class="activities><ul><li>Activity 1</li></li>Acivitiy 2</li></ul></div>
<div class="location"><h1>Location 2</h1>
... activities again....
... more locations ...
</div> //end trip
The idea is: The user can select a variable number of locations and therein add a variable number of activities. Data should be kept in local stores on the client side.
For the locations this was easy. They are stored in var locationStore = can.fixture.store and adding new locations using the "todo tutorial" works like a charm. For listing the locations I use the following template:
As you can see, I want to call another template (show-activties) to list the selected activities within a location. Problem is: I figured out how to pass the location name / or the location id to the show-activities template but I just don't understand how to set up a variable set of stores to hold the individual activity lists.
Is there a way to use a two dimensional array or a list within a list to accomplish this? I don't know how many locations the user will add so I need to be flexible and hard coding a couple stores won't solve the issue.
I am sure this is quite simple I am just not able to see the solution
Many thanks for your help,