Page 1 of 1

Updating specific label in list item

Posted: Fri Mar 07, 2014 10:40 pm
by Homan Mohammadi

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


Updating specific label in list item

Posted: Sat Mar 08, 2014 1:50 am
by Igor

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.


Updating specific label in list item

Posted: Sat Mar 08, 2014 2:17 am
by Homan Mohammadi

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


Updating specific label in list item

Posted: Sun Mar 09, 2014 5:15 pm
by Igor

Hi,

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