Page 1 of 1

How do I bind the Appery click event to items dynamically added to a list using jquery append

Posted: Wed Apr 24, 2013 3:30 pm
by Gary Staab

My application is dynmically adding to a list element. The click event works for any items in the list when it was initially create, but and dynmically added items don't respond to the click event.

What is the easiest way to bind the click event added thru appery to these dynmically added items.


How do I bind the Appery click event to items dynamically added to a list using jquery append

Posted: Wed Apr 24, 2013 6:00 pm
by Kateryna Grynko

Hi Gary,

There are two ways.

1) Create new List Item. On new List Item click run the following JavaScript:
codeAppery('mobileListItem').trigger('click')/codeAction added on click event for component 'mobileListItem' will be executed.

2) If new List Item name is the same as the List Item name then on the new List Item click Actions from the old List Item will be executed.


How do I bind the Appery click event to items dynamically added to a list using jquery append

Posted: Wed Oct 02, 2013 1:06 am
by bahar.wadia

Hello Katya,

I have the exact need.

I have tried your suggestion, but I don't think I have quite understood your recommendation. Below is a snippet of my code...what am I doing wrong ?

var Items = arguments[0];

Items.sort();

var FoundList = Appery("mobilelist_FoundItems");

FoundList.empty();

//Appery('mobilelist_FoundItems').trigger('click'); // This does not work

$.each(Items, function(index, option)
{
FoundList.append('' + option + '');
//Appery('mobilelist_FoundItems').trigger('click'); // This does not work, either
});

FoundList.listview("refresh");


How do I bind the Appery click event to items dynamically added to a list using jquery append

Posted: Wed Oct 02, 2013 3:03 am
by Alena Prykhodko

Please try to debug your app http://docs.appery.io/documentation/d.... Do you have any errors?


How do I bind the Appery click event to items dynamically added to a list using jquery append

Posted: Wed Oct 02, 2013 11:10 am
by bahar.wadia

I have debugged the application.

If I don't .empty() the List and simply .append() new items the first item is clickable, but all the appended items are not clickable.

If I .empty() the List and then .append() new items nothing is clickable.

Please read my questions again. Your response is not answering my questions.


How do I bind the Appery click event to items dynamically added to a list using jquery append

Posted: Wed Oct 02, 2013 5:18 pm
by Maryna Brodina

Hello! Instead preFoundList&#46;append('<li>' + option + '<&#47;li>');/pre please try
preFoundList&#46;append('<li> <a name="mobilelist_FoundItems_ITEMNAME">' + option + ' <&#47;a> <&#47;li>');/pre
where mobilelist_FoundItems_ITEMNAME - name of item in List mobilelist_FoundItems where you add event


How do I bind the Appery click event to items dynamically added to a list using jquery append

Posted: Sat Apr 04, 2015 9:15 pm
by Andrey Koposov

gfd