'Select2 - Setting ajax process Result function from data attribute

I need to dynamically set the "processResult" function in a Select2 that receives data from the server. On the documentation they say that it is possible to set the parameters via data- * attributes but I can't set this parameter (others I can.).

I tried both:

data-ajax--process-results="..."
data-ajax--processResults="..."

Has anyone had any experience with this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source