2010-06-15 32 views

回答

0

嘗試formatItem: function(){ ... }

$("...").autocomplete(data, { 
//..... 
    formatItem: function(item) { 
     return item.text.substr(0,item.text.lastIndexOf('-')); 
    } 
//.....  
}) 

更多it here.

+0

感謝快速回復,哥們,但我嘗試過了,跟它item.text未定義.. – Jos 2010-06-15 05:47:24

+0

好吧,從來沒有嘗試過,但我想,你可以檢查這裏的代碼示例... http://jquery.bassistance.de/autocomplete/demo/只是查看頁面源... – Reigel 2010-06-15 05:51:34

+0

,但非常感謝求助.. :) – Jos 2010-06-15 05:56:11