Page 1 of 2

Refresh just one item?

Posted: Thu Mar 26, 2015 3:53 am
by Ellen Schlechter

I have a list on a page. If a I click on an item in that list, I go to a different page where I can delete the item or update it. When I go back to the first page, how can I have it so only the one item refreshes. It makes the app slow to invoke the list service on page show every single time so I am trying to find a faster solution.


Refresh just one item?

Posted: Thu Mar 26, 2015 5:41 pm
by Egor Kotov6832188

Hello Ellen.

To implement this feature you need to use LSV created in Model&Storage, and update LSV, during item's details changing, then on the list page on page show always call mapping with this LSV mapped to the page.


Refresh just one item?

Posted: Thu Mar 26, 2015 6:53 pm
by Ellen Schlechter

Sorry I don't really understand what you said.


Refresh just one item?

Posted: Fri Mar 27, 2015 8:52 am
by Alena Prykhodko

Please tell us what exactly is not clear? What you have tried and what does not work?


Refresh just one item?

Posted: Fri Mar 27, 2015 12:26 pm
by Ellen Schlechter

I don't really understand any part of it. I want just one item to refresh instead of the list service being fully executed.


Refresh just one item?

Posted: Mon Mar 30, 2015 4:35 am
by Yurii Orishchuk

Hi Ellen,

There is not ready solution with drag and drop.

Thus only way is to:

  1. use local storage variable/or some storage to store needed information(including _id of editing item).

  2. when come back - you can find needed item by "_id" and update all inside items.

    This is brief plan. Details you should implement by your self.

    Regards.


Refresh just one item?

Posted: Mon Mar 30, 2015 7:37 pm
by Ellen Schlechter

Thanks for that. That is currently how I have the update set up. But here is my problem. I have one page where there is a list of items and if you click on an item, it goes to a different page where you can view and edit it. When I go back to the first page, however, the page relists and it scrolls all of the way back up to the top instead of staying in the same spot. This would be fine but when there are hundreds of entries, it is inconvenient to have to scroll through the list again.


Refresh just one item?

Posted: Tue Mar 31, 2015 4:05 am
by Yurii Orishchuk

Hi Ellen,

If problem only in scroll, you can:

  1. Store current scroll before invoking the service.

  2. Restore current scroll after "complete" event handler.

    Please read more info here: https://api.jquery.com/scrollTop/

    Regards.


Refresh just one item?

Posted: Tue Mar 31, 2015 2:03 pm
by Ellen Schlechter

That's a good idea.

How would I store and restore?


Refresh just one item?

Posted: Wed Apr 01, 2015 10:46 pm
by Ellen Schlechter

??