We have a grid that shows the data obtained from an API Rest. The JSON object returned by the API is also stored on a local variable (to avoid calling twice the API to get the same data). Whenever we click on any element of the grid, we store the value of the id that was clicked, and then navigate to another page where the complete data of that item is shown.
Everything works fine this way.
However, if the local variable has a value, we don't call the API REST, instead we use the local variable, showing the data on the grid with the same structure as it was provided by the API, but displaying it through a JavaScript script instead. The problem is that when we click on any of the shown data on the grid, the app navigates to the second page, but it never gets to store the id value on the local variable.
Any ideas on how to solve this? Thank you!
Note: We think that the JavaScript function that shows the items is correct, because we are also using that script to generate an infinite scroll (when the user scrolls down, new items are displayed), calling the API REST and then showing them through the same JavaScript function.