Hello!
How to make a lazy load for the list view page?
I took the data from the mysql database and they are very long.
Use this example - http://framework7.io/docs/virtual-list.html#examples
If you want to request all data at once, then none additional components is required.
If want show the list portion by portion, there are some ways:
- Based on pull to refresh event - http://framework7.io/docs/pull-to-refresh.html#pull-to-refresh-events, on every pulling you should request new portion of items
- Based on infinite scroll event - http://framework7.io/docs/infinite-scroll.html
- or on renderExternal params of virtualList, but it’s more complicated.
On 1st and 2nd don’t forget to use virtualList.replaceAllItems(items) method to replace old ones or use virtualList.appendItems(items)
Sorry, I haven’t seen that you need lazy load effect. What do you mean by that? Loading last items on request(user activity events) or on background by some timeout?
О, пропустил virtual list ! Да, подгружаю большое кол-во записей и хотел что-то вроде пагинации, иначе скорость создания страницы падает. Благодарю за подсказку!
Если есть время можно поэкспериментировать с renderExternal без всяких других компонентов(pull2refres и infinteScroll). Первый запрос делать более 30 единиц. И при достижении какой то границы, сделать на заднем фоне запрос на следующую партию.
да, точно, там есть fromIndex, toIndex … попробую, спасибо