Is there more than one jQuery Autocomplete widget?

Posted by Cheeso on Stack Overflow See other posts from Stack Overflow or by Cheeso
Published on 2010-03-11T01:37:01Z Indexed on 2010/03/23 14:03 UTC
Read the original article Hit count: 733

Filed under:
|
|

I thought there was only one - included in jQuery UI and documented here.

I know there are third-party autocomplete widgets that plug-in to jQuery, like the one from devbridge. But I would describe that as an autocomplete widget for jQuery, rather than the jQuery autocomplete widget.

But on Stackoverflow, I see questions asking about an autocomplete widget that does not use the syntax described in the jQuery UI documentation. For example:

The jQuery UI syntax looks like this:

      $("#input1").autocomplete({
          source: function(req, responseFn) {
                ...
          },

          select: function(value, data){
                 ...
          }
      });

Whereas some of those other questions hae a syntax like this:

  $("#city").autocomplete("CUList.asmx/GetCUList", { 
      dataType: 'jsonp', 
      parse: function(data)  
      { 
          var rows = new Array(); 
          for(var i=0; i<data.length; i++){ 
              rows[i] = { data:data[i], value:data[i].CUName, result:data[i].CUName }; 
          } 
          return rows; 
      }, 
      formatItem: function(row, i, n) { 
          return row.CUName + ', ' + row.CUCity; 
      }, 
      max: 50 
  });  

What's the explanation for the discrepancy? People ask about "jquery autocomplete" without specifying which one. With no direction, shouldn't I assume THE jquery UI autocomplete?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui