开发者

Telerik Textbox [RadInput] Not Supporting AutoComplete Implementation Using Jquery

开发者 https://www.devze.com 2023-03-15 16:23 出处:网络
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. T

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 //* * *

0

精彩评论

暂无评论...
验证码 换一张
取 消