Page 2 of 2

Issue Adding list item in code

Posted: Mon May 11, 2015 4:09 am
by Yurii Orishchuk

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.


Issue Adding list item in code

Posted: Wed May 27, 2015 8:46 pm
by Aeneas McBurney

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


Issue Adding list item in code

Posted: Fri Jun 05, 2015 3:48 am
by Yurii Orishchuk

Hi Aeneas,

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

Regards.