remove spinner from jquery ui autocomplete if nothing found

前端 未结 5 536
忘掉有多难
忘掉有多难 2021-01-12 16:10

I want to remove the spinner (picture which shows that it is loading) from the textfield which supports jquery ui autocomplete. As there is no event for \"no results returne

5条回答
  •  别那么骄傲
    2021-01-12 17:00

    As of jQuery UI v1.9 you can do something like the following:

    $( "#q" ).autocomplete({
      source: "${createLink(mapping:'qsearch')}",
      select: function( event, ui ) {
        foo( ui.item.id );
      },
      search: function( event, ui ) {
        $( "#spinner" ).show();
      },
      response: function( event, ui ) {
        $( "#spinner" ).hide();
      }
    });
    

提交回复
热议问题