sergiodlopes/jquery-flexdatalist

Search multiple data sources for faster search results

handiworknyc opened this issue · 0 comments

@sergiodlopes

$oginput.flexdatalist({
    minLength: 2,
    valueProperty: '*',
    searchContain: true,
    normalizeString: function (string) {
        return string.toLowerCase();
    },
    visibleProperties: ["title", "par_title", "type", "url"],
    searchIn: 'title',
    data: siteurl + '/search-data'
});

I'm using flexdatalist here: https://wtgrantfdn.xyz/the-library ...

the data loaded from the URL https://wtgrantfdn.xyz/search-data is quite large (1000s of rows) and there is a delay of several seconds between typing and the results rendering.

What I would like to do:

  1. load a much smaller JSON array only with popular searches directly to the page (no ajax request necessary)
  2. search this array initially
  3. and if no results are found in the smaller array, then make the ajax request to the full array.

Any help with regards to how to code this logic is much appreciated.

Thanks!