Page 1 of 1

Append text to dynamic list items

Posted: Sat Jan 24, 2015 11:41 pm
by Fotios Kotsiopoulos

Hi,

I've created a dymanic list which is populated by a rest service.

If the value is undefined I hide the element using the fillowing javascript:

if (typeof value === "undefined") {
$(element).hide();
}

However, if the value is defined I'd like to add text before each list item.

For example, if the service creates a dynamic list with three items, e.g.
Oranges
Apples
Bananas

I'd like the list to display "Select" before each item:
Select Oranges
Select Apples
Select Bananas

Thanks in advance

Image


Append text to dynamic list items

Posted: Sun Jan 25, 2015 4:22 pm
by Alena Prykhodko

Hello,

This should be done with code, for example, you can use localStorage:
prelocalStorage.setItem('LSVname', Apperyio("list").text());

Apperyio("list").text('Select' + localStorage.getItem('LSVname'));/pre

Where LSVname - name of localStorage variable (create it first http://devcenter.appery.io/documentat...)
list - list component name