List to Virtual List

Can I convert a list to virtual list? We are using V1

yes you can

https://v1.framework7.io/docs/virtual-list.html

What’s the difference of a List and virtual list?

Virtual list seems to have some functions/API

Can I use the functions/API of virtual list in a simple list?

from the docs:

Virtual List

Virtual List allows to render lists with huge amount of elements without loss of performance. And it is fully compatible with all Framework7 components which work with lists such as Search Bar, Infinite Scroll, Pull To Refresh, Swipeouts (swipe-to-delete) and Sortable.

List View (Table View)

List views are versatile and powerful user interface compontents frequently found in iOS apps. A list view presents data in a scrollable list of multiple rows that may be divided into sections/groups.

List views have many purposes:

  • To let users navigate through hierarchically structured data
  • To present an indexed list of items
  • To display detail information and controls in visually distinct groupings
  • To present a selectable list of options

You cant use VL api on List.

1 Like

How do you convert list to Virtual List?

If using the List View how do you add item programmatically?

$$('<li>'+ '<a href="" class="item-link f2pmsg newmsg prompt-title-ok" data-num="">'+ '<div class="item-content">'+ '<div class="item-media"></div>'+ '<div class="item-inner">'+ '<div class="item-title">New Message</div>'+ '</div>'+ '</div>'+ '</a>'+ '</li>').insertAfter('.list-block ul li:nth-child(1)');

This seems to work in adding an item. Adds a new item at the second position