I have an app which gets some data via REST. With this data I fill a List-Component via the hidden-ID concept introduced here (http://docs.appery.io/tutorials/build...) This works perfectly.
Now I change my App to get offline compatibility. All REST-Data will be downloaded and stored in the localStorage. The List-Component is populated like this:
----------------------------var list = Appery("AllQuestions");
var item = Appery("AllQuestionsItem");
for (x in activeMission.Question){
var itemToAppend = item.clone();
itemToAppend
.attr('style', '')
.attr('id', 'QuestionsList_AllQuestionsItem'+x)
.attr('idx', ''+x);
itemToAppend.children().children('#QuestionsList_QuestionName')
.text(activeMission.Question[x].name)
.attr('id', '#QuestionsList_QuestionName'+x)
.attr('idx', ''+x);
itemToAppend.children().children('#QuestionsList_QuestionID')
.text(activeMission.Question[x].id)
.attr('id', '#QuestionsList_QuestionID'+x)
.attr('idx', ''+x)
itemToAppend.appendTo(list);
}
item.remove(); // remove the proto-listitem
list.refresh();
When I now use the appery.io click method to set the localStorage-ID like before, it selects always the first entries id. Is there something missing or even a better way to populate the List with js?