내가 당신이 원하는 뭔가를 달성 할 수 있었다한다. 여기에 제가 한 일이 있습니다 만, Infragistics 패키지로 작동하는지 모르겠습니다.
1- JQuery UI 자동 완성 텍스트 상자를 다운로드했습니다. 2 사이트에 제공된 샘플을 약간 수정했습니다. 3 자동 완성을 위해 XYZ라는 클래스가있는 모든 드롭 다운을 수정하기 위해 무언가를 적용했습니다. 델리게이트를 사용 했으므로 UI에서 드롭 다운을 생성 할 때 자동 완성 텍스트 상자에 의해 자동으로 대체됩니다.
죄송합니다. 영어가 완벽하지 않으면 죄송합니다. 제 첫 번째 언어가 아닙니다. 여기
는 일부 코드 (참고 : 샘플에서 나는 라이브() 또는 대리인() 함수를 사용하지 않은)의
(function($) {
$.widget("ui.autoCompleteDDL", {
_create: function() {
var self = this;
var select = this.element.hide();
var _isHoverUl = false;
var input = $("<input>")
.addClass("ig_Edit igtxt_Edit")
.width(select.width())
.addClass(select.attr("class"))
.removeClass("AutoComplete DropDownList")
.click(function(e){this.select(); })
.insertAfter(select)
.autocomplete({
source: function(request, response) {
var matcher = new RegExp(request.term, "i");
response(select.children("option").map(function() {
var text = $(this).text();
if (!request.term || matcher.test(text))
return {
id: $(this).val(),
label: text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + request.term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"),
value: text
};
}));
},
delay: 100,
select: function(e, ui) {
if (!ui.item) {
// remove invalid value, as it didn't match anything
$(this).val("");
return false;
}
$(this).focus();
select.val(ui.item.id);
self._trigger("selected", null, {
item: select.find("[value='" + ui.item.id + "']")
});
},
minLength: 1
})
.blur(function(e){
var curInput= $(this);
if (!_isHoverUl){
setTimeout(function(){
curInput.val(select.get(0).options[select.get(0).selectedIndex].text);
input.autocomplete("close");
}, 150); // 150 is because of the autocomplete implementation.
}
});
// Fix for the scrollbar in IE7/8
$("body")
.delegate(".ui-autocomplete", "mouseover", function(evt){ _isHoverUl = true;})
.delegate(".ui-autocomplete", "mousemove", function(evt){input.focus();})
.delegate(".ui-autocomplete", "mouseout", function(evt){_isHoverUl = false;});
// Possibility of showing an arrow button.
$("<div> </div>")
.insertAfter(input)
.addClass("ui-icon-combo-arrow")
.mouseover(function(){$(this).toggleClass("ui-icon-combo-arrow ui-icon-combo-arrowH"); })
.mouseout(function(){$(this).toggleClass("ui-icon-combo-arrow ui-icon-combo-arrowH"); })
.removeClass("ui-corner-all")
.css({"display":"inline"})
.position({
my: "left center",
at: "right center",
of: input,
offset: "-1 0"
})
.attr("title", "")
.click(function() {
// close if already visible
if (input.autocomplete("widget").is(":visible")) {
input.autocomplete("close");
return;
}
// pass empty string as value to search for, displaying all results
input.autocomplete("search", "");
input.focus();
});
input.val(select.get(0).options[select.get(0).selectedIndex].text);
}
});
})(jQuery);
$(function() {
$("select.AutoComplete").autoCompleteDDL();
});
나는이
도움 희망