Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Issue Adding list item in code

Hi Aeneas,

Yes if you populate items manually builder events will not work.

In this case you need to handle them manually too.

For example:

pre

//Create li element.
var li = jQuery('ssss');

var onClick = function(){
alert("list item click");
};

li.bind("click", onClick);

li.appendTo(...);

/pre

Regards.

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Issue Adding list item in code

Hi Yurri,

I have just got around to trying this and its still not working. Below is the portion of my code. The onClick function still returns the name of the listitem set at design time and not the name I am assigning it at runtime which is the expense id. There's also a warning saying don't put functions within loops but it still works.

Code...
Image

Thanks,
Aeneas

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Issue Adding list item in code

Hi Aeneas,

Please try to delete closest("li") part of your code.
Details: http://prntscr.com/7dankr/direct

Regards.

Return to “Issues”