customize ionic searchable component

Viewed 454

I'm using basic ionic searchable component and it's working fine,

<ion-item>
    <ion-label>Port</ion-label>
    <select-searchable
        item-content
        [(ngModel)]="port"
        [items]="ports"
        itemValueField="id"
        itemTextField="name"
        [canSearch]="true"
        (onChange)="portChange($event)">
    </select-searchable>
</ion-item>

The problem is that I've a pretty big array, around 8k records, and it loads really slow, how can I overcome that? any ideas? Can I display a small chunk of the data but still search in the whole array? thanks.

here's the component I'm working with. https://www.npmjs.com/package/ionic-select-searchable

2 Answers

I've found out a smarter solution like so:-

I created a Modal that pops up in a different view which loads all the list in there, where i used the default search bar in ionic Search Bar which can be customized for 2D array, and there i could use Virtual Scroll because i needed to search in all array, so i couldn't use Infinite scroll

which i found in this Youtube Video so helpful, and that helps like a charm. hope this helps some one. thanks.

Related