Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Refresh One List Item

Is there a way to refresh one list item without reloading the entire list? I'm trying to edit variables in one list item, but it is changing all of the values.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Refresh One List Item

Hi Doug,

Can you show the code you tried?

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Refresh One List Item

All I had tried at this point was to invoke the service for the list. I just wasn't sure if there was a way to refresh only one DIV or list item. I've looked at some JQuery ways that I will try, but wanted to see if you had some advice for me.

Thanks Illya!

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Refresh One List Item

Try something like this: pre$("#list1").listview ("refresh");pre
-- list1 - is your list element you want to refresh./pre/pre

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Refresh One List Item

Thanks! I'll try it after the update is over!

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Refresh One List Item

I just tried the code. Didn't work. Any other ideas?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Refresh One List Item

Doug, please can you post some code example that you using now, and what you want to get as a result?

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Refresh One List Item

Happy to!

I've created a list that individuals can submit requests to. I want to be able to click a "Like" button to add to a counter for that particular request.
Image

I have the service set up to like the request and add to the counter. However, I want to limit each user to like a request ONLY once (so to avoid spam). The person doesn't register to gain access to the list, and I'm trying to avoid creating another collection to log each click.

So, I want to be able to read when a person clicks the "Like" button. Then, I had thought to write it to a label in the list and change the color of the "Like" button. However, when I had changed values and colors in the list item, nothing happened. Then, if I called the List service, it changed every list item.

I hope this explains it!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Refresh One List Item

Hello! Could you please post the code you use to change values and color?

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

Refresh One List Item

I did it through events after the click.
Image

Upon "success" of the service, it would:

  1. Change the picture asset via Javascript (example: Appery('picturename').asset('src','URL'),

  2. Change the text of the Notation Label from false to true (true meaning you clicked on it and should not be able to click on it again).

  3. Change the text below it to say Thank you.

  4. Invoked list service.

    Forgive me I don't have actual pictures, as I had to rebuild some it last night. This is how I did it, but I'd like to do it via Javascript.

Return to “Issues”