This is a migrated thread and some comments may be shown as answers.

change transport / read / url

2 Answers 392 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Wyatt
Top achievements
Rank 1
Wyatt asked on 23 Sep 2014, 08:39 PM
I am currently using the below to setup my autocomplete.  it works well, however, it seems to bind the url just once, I need it to bind again later so that I can send a different value.
IE this $("#impRacf").val()  changes, and I need that to reflect in my call.  thanks!

    $("#sellerNameFilter").kendoAutoComplete({
        placeholder: "Enter Seller Name ...",
        dataTextField: "seller_name",
        filter: "searchValue",
        minLength: 3,
        dataSource: {
            type: "json",
            serverFiltering: true,
            serverPaging: true,
            pageSize: 20,
            transport: {
                read:
                    {
                        url: publish + "/home/sellerName?&id=" + $("#impRacf").val()
                    }, //read
                parameterMap: function () {// send value of autocomplete as the "startsWith" parameter
                    return {
                        searchValue: $("#sellerNameFilter").data("kendoAutoComplete").value()
                    };
                }
            } //transport
        } //datasource
    }); //kendoAutoComplete

2 Answers, 1 is accepted

Sort by
0
Holger
Top achievements
Rank 1
answered on 24 Sep 2014, 06:23 AM
Hello Wyatt,

According to the documentation you can use a function instead of a URL. Please refer to the sample provided with the documentation.

Regards,
Holger
0
Holger
Top achievements
Rank 1
answered on 24 Sep 2014, 06:27 AM
The link to the documentation is not functional, so here is it again: http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-transport.read
Tags
AutoComplete
Asked by
Wyatt
Top achievements
Rank 1
Answers by
Holger
Top achievements
Rank 1
Share this question
or