I created a form to edit existing database entries. The database is set to read/write. All the input fields are bound, everything works as far as editing an entry.
To select which entry to edit, I have a table that displays the data base. The table captures a click event on a row and stores the row number in a wix data session. This takes into account the number of items per page and which page is being displayed.
When the edit button is clicked a light box opens with the form for editing. I am able to edit the information and submit it.
Where i'm having difficulty is which entry is being edited. No matter what I do it always ends up at item index 0.
Regardless of whether I do setCurrentItemIndex() on page ready or database ready I always get item index zero. I've tried throwing in a save and/or refresh with no luck.
What is needed to get setCurrentItemIndex() to select and particular index?