Homan Mohammadi
Posts: 0
Joined: Mon Feb 17, 2014 10:30 pm

Updating specific label in list item

Hi,

I am trying to access a particular label in a list item, but I am not sure how to do this. The results of a query are being mapped to this list item (i.e. iterated list). After this, I want to update a particular label, but am not sure how to access it. Using Appery('name_of_label').text('updated_text') updates ALL of the labels with that name.

Just an example of what I'm trying to do: if the list is called "list1" and the labels are "label1", "label2", and "label3", I am trying to update "label3" in the fourth list item (i.e. iteration) of "list1". How would I go about this?

Thanks so much!
Homan

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Updating specific label in list item

Hi,

Below code will return all mobile list items.
pre
code
Appery("mobilelist").each(function(index) {
alert(index + ': ' + Appery("mobilelist").text());
});
/code
/pre
where "mobilelist" - list component name. You could manipulate values like you need.

Homan Mohammadi
Posts: 0
Joined: Mon Feb 17, 2014 10:30 pm

Updating specific label in list item

Hi Igor,

Thank you for the help. I'm still now sure how this would allow me to change a particular label. The code that you shared would allow me to go through each list item and grab the text in it, correct? But what if I'm trying to go specifically to the 3rd (or 4th or 5th) list item? And then what if I'm trying to change a particular label in that list item?

Thanks again for your help!
Homan

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Updating specific label in list item

Hi,

Let us know if this help
https://learn.jquery.com/using-jquery...

Return to “Issues”