Hi there, I have a table with select elements in every rows.
When the page loads, the rows get filled with data from my datbase.
The user is able to use the select element which open a modal to validate the new information selected.
My problem is if the user selected a wrong info and the user closes the modal to cancel it.
On the database it won’t change the information selected, but on the user view the selected text stays, which is not so cool! I would like to add in the closing modal workflow a way of putting back the actual infos. I managed to store the old info in a variable when the user select the new option. But i can’t find a way of re-updating the select element text once the workflow of closing modal has been used.
I also thought about re-fetching the data to update the view, but fetching the data doesn’t reupdate the view apparently.
My only idea rn is to window.location.reload();
But i don’t like this solution doesn’t seem viable in the long run…
If you have any ideas !
Thanks