2010-06-15 54 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