Excuse the noobie question, I must be doing something obviously wrong... So 
hopefully the old hands can help.

I have a SilicaListView backed by a ListModel, and a pulley-menu command to add 
an item to the end of the model via ListModel.append(). After adding, I want to 
scroll the SilicaListView to the bottom to make the newly added item visible. 
So I thought using scrollToBottom() would do just that:

function addNewItem() {
  myListModel.append({ "role1": 0, "role2": 0 });
  mySilicaListView.scrollToBottom();
}

However, the view scrolls to the item above the one I just added, as if the 
view has not yet updated. Should I be binding the scrollToBottom() call to 
ListView.onAdd() instead? And if so, should I do that in my function so that it 
is only bound when first needed, for efficiency reasons? Or am I doing this all 
wrong, should I be using currentItem and highlightFollowsCurrentItem instead?

Many thanks,
Chris

_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to