$(".TerminalAutocomlete").autocomplete({
source: "./TerminalAutocomlete.php?Cmd=AdminTerminalSearchFrom",
// full link http://testwork.ru/FL/1928673/TerminalAutocomlete.php?Cmd=AdminTerminalSearchFrom
focus: function( event, ui ) {
//$(this).val( ui.item.title );
return false;
},
select: function( event, ui ) {
$(this).val( ui.item.value );
$(".type").val( ui.item.id );
$(".t").val( ui.item.id );
return false;
}
});
请告诉我如何通过自动填充得到计数结果?
答案 0 :(得分:0)
在猜想中使用open函数,列表的长度为:
$( ".TerminalAutocomlete" ).autocomplete({
source:"./TerminalAutocomlete.php?Cmd=AdminTerminalSearchFrom",
open: function(event,ui){
var len = $('.ui-autocomplete > li').length;
console.log('Founded '+len+' results');
}
});
答案 1 :(得分:0)
$(".TerminalAutocomlete").autocomplete({
source: "./TerminalAutocomlete.php?Cmd=AdminTerminalSearchFrom",
response: function( event, ui ) {
console.log(ui.content.length); //in this moment you get count results you
},
focus: function( event, ui ) {
//$(this).val( ui.item.title );
return false;
},
select: function( event, ui ) {
$(this).val( ui.item.value );
$(".type").val( ui.item.id );
$(".t").val( ui.item.id );
return false;
}
});
享受!的