Search reversed in Select2 without using Ajax

Asked

Viewed 121 times

-1

In Datatables.js the search works this way:

Product Name: Meias Vermelhas

The search returns the item if you type: Vermelhas Meias

How to have the same search efficiency as Select2?

Ref: https://select2.org/searching

1 answer

0


In the Select2 this feature does not exist natively and I had no results doing manually, despite being able, the performance was not cool.

By insisting on the searches, I found an alternative that solves the problem natively, is lighter and solved everything, the selectize.js

To understand an example of the result, see below:

inserir a descrição da imagem aqui

Any term entered will be covered by the search of the select, regardless of the word order. This happens locally, within the select elements, without the need for an ajax query and the backend to handle.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.