Corectare performanta scazuta la jQuery autocomplete

Datorita unui bug in componenta ui.autocomplete  din libraria jQueryUI  de fiecare data cand utilizatorul tasteaza in campul text performanta cautarii scade. Pentru a corecta acest lucru se adauga $(this).data(“ui-autocomplete”).menu.bindings = $();  in sectiunea search :

$("#birds").autocomplete({
    source: "search.php",
    minLength: 2,
    select: function(event, ui){
        log("Selected: " + ui.item.value + " aka " + ui.item.id);
    },
    search: function(e,ui){
        $(this).data("ui-autocomplete").menu.bindings = $();
    }
});

Detalii: https://bugs.jqueryui.com/ticket/15082

Leave a Reply

Your email address will not be published. Required fields are marked *