Monaca Onsen UI Discord Chat Github Repo

lazy list and "go to" an item

  • Is it possible to “scroll” to an item that has been removed from the DOM due to the lazy system? Or, more specifically, in my case, I might add an item to the data set that feeds the lazy list, but due to what part of the list I am viewing, the added item may not appear in the DOM after a lazy.refresh. I would like to progmatically “scroll” to a specific item that I just added, even if that item isn’t in the DOM. The reason: when an item is added, I want to view the list so that I can see and flash the list item that was just added to the data. It would be neat if there was a method such as .goto(index). From what I can tell, there is not.

  • Onsen UI

    The functionality of ons-lazy-repeat is relatively basic, allowing for the scrolling of simple lists. For this kind of dynamic functionality, I would recommend using ons-list instead. Unless you have hundreds or thousands of items, I don’t think you are likely to notice a huge performance difference.