Page 2 of 2

Populate menu select item from local variable array

Posted: Thu Sep 05, 2013 9:29 pm
by Kevin6209373

This is the code I was executing:

var data = ["Localstorage item 1", "Localstorage item 2", "Localstorage item 3"];

var listComponent = Appery("mobileList");
$.each(data, function(index, value) {
listComponent.append(
$('a rel="nofollow"' + value + '/a')
);
});
listComponent.listView("refresh");


Populate menu select item from local variable array

Posted: Thu Sep 05, 2013 10:23 pm
by Kevin6209373

I got the following variation on your sample code to work..

//I HAD TO MOVE WHERE THE .listview('refresh') was
// I know a single refresh at the end should work, but I couldnt get it to.

var data = ["New item 1", "New item 2", "New item 3"];

var listComponent = Appery("mobilelist_test1");
$.each(data, function(index, value) {
listComponent.append(
$('a rel="nofollow"' + value + '/a')
).listview('refresh');
});

//This refresh from your sample did not work for me:
//listComponent.listView("refresh");
//The following didnt work for me either:
//listComponent.listView('refresh');


Populate menu select item from local variable array

Posted: Mon Oct 14, 2013 12:31 pm
by Kirit Vaghela

Hello

In my case listview has grid with columns

  1. column has static image

  2. column has two lables ( i.e title and description )

  3. column has arrow image.

    I have json data in localStorage and I also get title and description data from json data.

    Now I want to bind this title and description to list view.

    So how can I bind two data.

    Thanks

    Image


Populate menu select item from local variable array

Posted: Mon Oct 14, 2013 3:50 pm
by Maryna Brodina

Hello!
1) Parse your data from localStorage - this should help https://getsatisfaction.com/apperyio/...
2) Add Item to the List with needed structure - instead pre&#46;append($('a rel="nofollow"' + value + ''))/a/pre add needed html structure to li, not just < a tag
3) Refresh the List


Populate menu select item from local variable array

Posted: Tue Oct 15, 2013 11:44 am
by Kirit Vaghela

Thanks Maryna
I'm getting error "TypeError listComponent.listView is not a function"
I don't understand this error.
code
var listComponent = Appery("mobilelist_2");
listComponent&#46;append('<li>'+text to append+'<&#47;li>');
listComponent&#46;listView("refresh");
/code


Populate menu select item from local variable array

Posted: Tue Oct 15, 2013 11:56 am
by Maryna Brodina

Please replace listComponent.listView("refresh"); with listComponent.listview("refresh");


Populate menu select item from local variable array

Posted: Wed Oct 16, 2013 7:58 am
by Kirit Vaghela

Thanks again Marya