How can I create a 'drill down' facility with a collection view?

Maybe the solution is a hybrid between what you did on the web app and the custom back button approach.

Triggering a query to refresh the current screen isn't a problem. You can hook it to the collection view's on press/click event handler to trigger a query by passing a variable/ID to the query based on the selectedIndex/selectedItem of the collection view.

I recently came up with a new way to pass variables to queries, especially if using temporary states: here's the link.

Triggering the query will automatically refresh the current's screen data, so you don't have to navigate and target the page you're on.

I don't know how standardized your data is, but I suppose there may be the issue of telling the collection view what data goes where (item.name in title, item.description in body, etc.).

With this dynamic approach, the main challenge would be the back button, but as long as you keep track of the data type you're showing at every step via temp states, it could be as simple as triggering the same query with the previous variable.

1 Like