Joni de Campos
Posts: 0
Joined: Fri Dec 11, 2015 12:21 pm

Need actions events to repeat on a button on a dynamic list

I created a order page and have to buttons. One to increase the product quantity and other to decrease the product quantity.

A attach several Set storage and Run Javascript on the plus and minus image button,on the first item of the list.

When a test the App only the plus and minus buttons work on the first item of the list.

How can I set the events to automatically repeat on the plus and minus button of each list item ?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Need actions events to repeat on a button on a dynamic list

Hello Joni,

Please clarify, did you set item's IDs to that buttons as attributes? You have to set them as described here: https://devcenter.appery.io/documenta...
And read on the click event to execure "plus" or "minus" service

Joni de Campos
Posts: 0
Joined: Fri Dec 11, 2015 12:21 pm

Need actions events to repeat on a button on a dynamic list

Thanks Sergiy for your reply.

Trying out....

Joni de Campos
Posts: 0
Joined: Fri Dec 11, 2015 12:21 pm

Need actions events to repeat on a button on a dynamic list

I manage to make it work, but know I have to set subTotal Label from the localStorage variable subTotal

This is the code I have:

element.on("click", function () {
Apperyio.storage.ProdutoSelecionado.set(value);

Apperyio.storage.ProdutoSelecionado.update("$['SubTotal']", "$ 100.00");

// this set the SubTotal localStorage variable. I need to transfer this value to the SubTotal Label.

//The bellow code does not work ! Apperyio('subTotal').text(Apperyio.storage.ProdutoSelecionado.get("$['SubTotal']")) ;
// this code is supposed to set the value from localStorage to the subTotal Label

});

Joni de Campos
Posts: 0
Joined: Fri Dec 11, 2015 12:21 pm

Need actions events to repeat on a button on a dynamic list

Ok...Got the code to work.

Now what is missing is a way of updating the value returned by the function bellow:

//this gets the object field values from database to be put in the localstorage.
element.on("click", function () {
Apperyio.storage.selectedListItem.set(value);
});

//do something with this information.

// need code here to update the selectedListItem

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Need actions events to repeat on a button on a dynamic list

Glad to hear things are sorted out now!

Return to “Issues”