I want To Implement AutoComplete Functionality On开发者_StackOverflow Telerik TextBox [RadInput] Using Jquery And Web Service.When I enter Any Character, I receive relative Suggestion From Database. This All Works Fine If i Use Simple ASP Textbox. It doesn't Work With RadTextBox.
Any Idea Why This Happens ?
Please Don't Provide Me This Link Of RadComboBox http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/autocompleteclientside/defaultcs.aspx I only Want To Use RadTextBox.
Thanks In Advance..
Pratik Bhatt
I've used this before with success -
http://www.dotnetcurry.com/ShowArticle.aspx?ID=515
I just modified the script slightly, as follows -
$(function() {
$(".tb").autocomplete({
source: function(request, response) {
$.ajax({
url: "EmployeeList.asmx/FetchEmailList",
data: "{ 'mail': '" + request.term + "' }",
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 {
Cost: item.Cost //***
}
}))
},
select: function( event, ui ) {
$find("<%= RadTextBox1.ClientID %>").set_value(ui.item.Cost); //***
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
}
});
},
minLength: 2
});
});
I've marked the lines of interest with //* * *
精彩评论