How do I add a List Item manually?
How do I remove current selected item from the list?
Thanks.
How do I add a List Item manually?
How do I remove current selected item from the list?
Thanks.
Hi Yoshi,
You can add this event handler for listitem: pre$(this).parent().remove();
Apperyio("mobilelistName").find("li:nth-child(1)").addClass();/preWhere 'mobilelistName' is a list component name.
I don't fully understand the addition part here and would appreciate if someone could help. I have a mobilelist item on a page, and a text label placed inside the list item. For my application, I need to grow this list every time a button click is done. For example, the list should grow incrementally on every button click as follows:
January
February
March
April
....
...so on.
This means, I have to manually increment the list, but I have no idea how to do that. Please help.
I don't fully understand the addition part here and would appreciate if someone could help. I have a mobilelist item on a page, and a text label placed inside the list item. For my application, I need to grow this list every time a button click is done. For example, the list should grow incrementally on every button click as follows:
January
February
March
April
....
...so on.
This means, I have to manually increment the list, but I have no idea how to do that. Please help.
ping! ..anyone?
Hello Xman,
pre.addClass();/pre
Was added accidentally.
[quote:]but I have no idea how to do that.[/quote]
1) Please find item that has :
data-appery-tpl="true"
attribute
http://gyazo.com/9fab3879237a981307ac...
2) clone it
3) append to your list
There is another way: you can map LSV which will have to be an array
Much easier to add element to the array and map array, so Appery.io will do all the hard work
You can find how to map array to the selectmenu here
http://blog.bismallion.com/map-appery...
The first solution I completely don't understand.
I understand the second solution, but my issue is that I need a way to "append" to an LSV array, not "set". The issue is that the service I have only returns one element at a time in response. I run this service many times and want that each time the single value returned by this service is pushed onto my LSV array.
There is Appery.io.storage.myarray.set in this example, is there something which I can use to append to my array?
Hi -
myarray is a localStorage variable, so you could use only set and get methods to it, there is no 'append'.
But you can create new array from old value of Apperyio.storage.myarray and your response. And set this new array to Apperyio.storage.myarray. You can do it in such way:
pre
code
/* your response /
var yourNewArrayElement = {"name":1, "value":1};
/ we get old value of Apperyio.storage.myarray /
var temp_arr = Apperyio.storage.myarray.get();
/ Append your response to value of Apperyio.storage.myarray /
temp_arr.append(yourNewArrayElement);
/ set Apperyio.storage.myarray new value */
Apperyio.storage.myarray.set(temp_arr);
/code/pre
Can you elaborate a bit on the data-aperry-tpl="true" solution above. I think this might work for me, but I am confused how to implement it?
Can anyone please elaborate a bit on the data-aperry-tpl="true" solution above. I think this might work for me, but I am confused how to implement it?