只有輸入第一個(gè)字符有提示,其他字符則不行
$(function?()?{ ????????????????var?arrUserName?=?["王五",?"劉明",?"李小四",?"劉促明",?"李淵",?"張小三",?"王小明"]; ????????????????$('#txtSearch').autocomplete(arrUserName,?{ ????????????????????minChars:?0,?//?雙擊空白文本顯示全部提示數(shù)據(jù) ????????????????????formatItem:?function(data,?i,?total)?{ ????????????????????????return?"<i>"?+?data[0]?+?"</i>"; ????????????????????}, ????????????????????formatMatch:?function(data,?i,?total)?{ ????????????????????????return?data[0]; ????????????????????}, ????????????????????formatResult:?function(data)?{ ????????????????????????return?data[0]; ????????????????????} ????????????????}).result(SearchCallback); ????????????????function?SearchCallback(event,?data,?formatted)?{ ????????????????????$('.tip').show().html("您選擇的是"?+?(!data???"空"?:?formatted)); ????????????????} ????????????});
只有輸入第一個(gè)字符有提示,比如李小明,輸入李會(huì)有提示,而輸入小或者明就不會(huì)有已是,是這個(gè)插件本身就這么設(shè)計(jì)的嗎?
2017-01-04
雙擊文本框就會(huì)出現(xiàn)全部