Setting local storage variable from results of query service
I'm building a social networking app in which the user has to search their city, choose their city from the list of results, and then write a post that other users from that city will be able to see. So I have a Cities collection that holds every city in the US, and then a Posts collection where one of the columns is CityID, the unique identifier from the cities collection. When the user taps on their city, I need it to store the _id of the Cities collection in a local storage variable called 'CityID'. The city and state is displayed in a label within a grid component that the Cities query service is mapped to. On the grid component I added Javascript to also create an attribute for the _Id, and then I have a click event on the label that's within the grid component to set that attribute (the _id from the cities table) as local storage variable 'City ID' when the user taps on it. Then the next click event is to navigate to the next page. My problem is, nothing is happening when I tap on a city from the list of cities. It doesn't take me to the next page, which makes me think the javascript command to set the local storage variable is failing. See screenshot below for the setup. Is the problem that I'm using a Grid component, and clicking on a label within that grid? Since the JS that creates the attribute is on the grid and not the label? Please help! Thanks.