[英]jQuery.UI.autocomplete widget, automatically role up the list instead of roling down if there isn't enought room
[英]jquery.ui.autocomplete not hitting stored procedure
我具有以下函数,该函数应基于在文本框中输入的姓氏或ID返回值。 它无法在我的基础页面上运行,该页面具有多个选项卡层,并且自动完成功能位于子选项卡之一中。 所以我在新页面上剪掉了一个尝试过的函数,并且能够得到我的结果。 因此,选项卡的级别可能与此有关。 在文本字段中,我在测试页和基础页上都有一个onfocus = FillStaff(),但是它仅在测试页而不是选项卡页上进入此函数。
function FillStaff() {
if ($("#txtSearchCriteria").val() == '') {
$("#txtSearchCriteria").autocomplete({
source: function (request, response) {
$.ajax({
async: false,
delay: 250,
url: 'wsCourse.asmx/GetStaffList1',
data: "{'Param1':'" + $('#hdfldUser').val() + "', 'Param2':'" + request.term.replace(/'/g, "\&apos") + "'}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
dataFilter: function (data) { return data; },
success: function (data) {
response($.map(data.d, function (item) {
return {
label: item.split('|')[0],
val: item.split('|')[1]
} // end of return
})) // end of response
} // end of success
}); // end of ajax
}, // end of source
select: function (e, i) {
$('#hdfldStaffID').val(i.item.val);
}, // end of select
change: function (event, ui) {
if (!ui.item) {
$(event.target).val('');
}
},
minLength: 3
}) // end of txtSearchCriteria.autocomplete
}
} // end of FillStaff
谢谢你的帮助。
<div id="courseButtons" >
<button id="btnAddNewCourse" type="button" class="button" >Add New Course</button>
<asp:Label ID="lblNameSearch" runat="server" CssClass="label" Text="Search by Last Name or PIC:"></asp:Label>
<input id="txtSearchCriteria" type="text" onclick="javascript: this.select();" onfocus="FillStaff()"/>
</div>
我正在使用未声明的变量。 对不起,我浪费了您的时间。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.