Virtuallist question (skip item?)


I have kind of an edgecase with virtuallist and was wondering what the best way to approach it was.

Basically, I have a virtual list that loops over an object list. This works just fine however my object list is a reference list of ID’s. These IDs then reference another object for the details and build outs the list element with things like title, date etc.

Again, this works just fine however if there is a case where an ID is not in our reference list it errors out the virtual list because it cant build that specific item.

What I’m looking to do is essentially check if there is a matching element, if so let the virtual list keep going, however if its not, simply skip that item.

I have tried to do things like

if ( item.length == 0)
return false;

and even just returning an empty string but I get errors like

Uncaught TypeError: Cannot set property ‘f7VirtualListIndex’ of undefined


There is no such logic in VL and it is heavily tight to item indexes. So it is better to just filter array of IDs before you pass them to VL

Ok thanks! I’ll just rework the data before it sends to the VL.