autocomplete change event

autocomplete change event

pearly_030pearly_030 Posts: 42Questions: 0Answers: 0
edited November 2011 in General
Hello,

I've a problem with autocomplete fonction.
When I select a new item in the autocomplete list, the event change is not immediately applied.
In fact, the alert "changed" is OK but oTable1.fnDraw() is KO.
I've to click on an other field to see the change's result.
Can you help me ?

Thanks.

html code :
[code]

[/code]

js :
[code]
$("#destination").autocomplete(
{
source: new_liste_sites,
width: 320,
change: function(event, ui) {

alert("changed"); // Alert is OK

oTable1.fnDraw(); // KO

}
});
[/code]

Replies

  • pearly_030pearly_030 Posts: 42Questions: 0Answers: 0
    I found a solution.
    I add focus and then it woks correctely.
    Here my new code :
    [code]
    $("#destination").autocomplete(
    {
    source: new_liste_sites,
    width: 320,
    focus: function( event, ui ) {

    $( "#destination" ).val( ui.item.value );
    return false;
    },
    change: function(event, ui) {
    oTable1.fnDraw();
    return ;
    }
    });
    [/code]
This discussion has been closed.