2009-08-01 98 views

回答

0

使用extraParams選項。這裏是一個例子:

jQuery("#InvestorName").autocomplete('<%= Url.Action("Autocomplete", "DocMgmt") %>', { 
     dataType: 'json', 
     extraParams: { type: "InvestorName" }, 
     max: 20, 
     width: 355, 
     matchContains: "word", 
     autoFill: false, 
     parse: function(data) 
     { 
      var rows = new Array(); 
      for (var i = 0; i < data.length; i++) 
       rows[i] = { data: data[i], value: data[i].InvestorId, result: data[i].InvestorName }; 
      return rows; 
     }, 
     formatItem: function(row, i, max) 
     { 
      return i + "/" + max + " [" + row.InvestorName + "]" + " (id: " + row.InvestorId + ")"; 
     }, 
     formatMatch: function(row, i, max) 
     { 
      return row.InvestorName + " " + row.InvestorId 
     }, 
     formatResult: function(row) 
     { 
      return row.InvestorName; 
     } 
    }).result(function(event, data, formatted) 
    { 
     jQuery('#InvestorId').val(formatted); 
    }); 
+0

感謝CurlyFro,希望我需要做的是收集選項使用$ _GET作爲即時通訊使用它來更改SQL語句。 – gus 2009-08-01 07:35:07