开发者

Jquery autocomplete - how to massage the options before displaying?

开发者 https://www.devze.com 2023-01-03 06:26 出处:网络
I m using autocomplete from http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ jQuery Autocomplete p开发者_开发知识库lugin 1.1

I m using autocomplete from

http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/

jQuery Autocomplete p开发者_开发知识库lugin 1.1

i managed to get data from server in below form with sepaerator to id as "-", but i dont want to show this id in list while selecting but sending it as hidden data.Please suggest.

Exon: Supplier HJR/VAKJ -1


try formatItem: function(){ ... }

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

more on it here.

0

精彩评论

暂无评论...
验证码 换一张
取 消