Reputation: 435
In the main page of my website there is a long list, <ul>
. Each list item represents a model object. Within the list there are the objects attributes, for example its name etc, and also buttons to change those attributes. The list is loaded from the sqlite database. The issue is since each button changes data in the database, to display the changed data, the view function reloads the page on each button click. That is fine, except the list is very long, and is necessary to scroll down, and on each button click, the page is reloaded therefore goes to the very top of the list. This makes the webpage almost unusable, or at least very annoying to use.
Can someone recommend a workaround to this problem. Please let me know if my question is not clear
Upvotes: 0
Views: 39
Reputation: 1233
It looks like what you want to achieve is something that should be done with Javascript. It will be the simplest way of doing it! For instance, you can call the corresponding API when the user clicks on one of the buttons, and if the API returns 'OK' then you can just update the item with the changes you made (because if the server returned yes, then you can assume that the local version of the data is the same than the one on the server)
Upvotes: 1