Fotios Kotsiopoulos
Posts: 0
Joined: Mon Dec 08, 2014 9:32 am

Append text to dynamic list items

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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Append text to dynamic list items

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

Return to “Issues”