0
我正在使用jquery ui v1.10.3和style v1.10.3庫。 的jQuery klibrary版本是v1.9.1的jquery ui自動完成未列出結果
這是我的文本框
<input type="text" name="txtCustomer" id="txtCustomer" />
,我有這個js
$("#txtCustomer").autocomplete({
source: function (request, response) {
$.ajax({
url: '/kpanel/handlers/content.aspx?act=getCustomer&d=' + d,
dataType: 'json',
data: { name: encodeURI(request.term) },
success: function (z) {
response($.map(z.Data, function (item) {
return {
label: item.Name,
value: item.Name
}));
}
});
},
select: function (event, ui) {
$("#lblType").html(ui.item.TypeName);
$("#lblCode").html(ui.item.CustomerCode);
},
open: function() {
$(this).removeClass("ui-corner-all").addClass("ui-corner-top");
},
close: function() {
$(this).removeClass("ui-corner-top").addClass("ui-corner-all");
}
});
,這是我的結果JSON數據
{
"Data": [
{
"Name": "Kolya Husten",
"CustomerCode": "MT20132645",
"TypeName": "Normal",
"Email": "[email protected]",
"Telephone": "0(234)567-89-45",
"MobilePhone": "0(234)567-89-76",
"DiscountRatio": "0"
},
{
"Name": "Loya Mantus",
"CustomerCode": "MT20132602",
"TypeName": "Normal",
"Email": "[email protected]",
"Telephone": "0(212)268-02-22",
"MobilePhone": "0(536)448-96-67",
"DiscountRatio": "10"
}
]
}
一切看起來不錯,但結果不顯示如圖所示圖片