notlkk
notlkk

Reputation: 1231

Kendo AutoComplete

I want to use kendo AutoComplete in a kendoGrid for inline editing. When user inputs anything I'd use it to call a RESTful web service to return a list of products with names that start with the input value.

My questions are:

  1. My web service expects a request looks like http://localhost/myService/appl where "appl" is the value that user enters and the prefix. However, kendo seems to always format the request something like http://localhost/myService?product=appl. How do I change the format?

  2. How do I get the value that user has input in the grid (the AutoComplete textbox) so I can pass it in the request URL?

Upvotes: 0

Views: 996

Answers (1)

OnaBai
OnaBai

Reputation: 40897

Define in the DataSource of your autocomplete an url function.

In that function, you can get typed value as:

var val = op.filter.filters[0].value;

and then return the url with the composed value.

Then it is something like:

dataSource: new kendo.data.DataSource({
    transport: {
        read: {
            url: function (op) {
                var val = op.filter.filters[0].value;
                return "/myService/" + val;
            }
        }
    }
})

Upvotes: 1

Related Questions