Reply To: Select2 with custom matcher function

#10035247
Support
Keymaster

Hello, thanks for your purchase.

When we need a more customizable method to initialize a plugin, the best way is manually instead of trough data-plugin-selectTwo.

Please follow the steps below:

1) Change the HTML of select to:

<select class="my-custom-select2 form-control populate">......</select>

* Note I removed the data-plugin-selectTwo attribute.

2) Initialize the Select2 manually by adding the code below at “js/custom.js”:

$('.my-custom-select2').select2();

* You mentioned ajax returning JSON and custom function. Probably the best code is the one on this link:
https://select2.org/data-sources/ajax#additional-examples

We hope this helps!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.


If you are satisfied with Porto Admin and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads