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

Autocomplete serverfiltering

1 Answer 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paweł Sieniawski
Top achievements
Rank 1
Paweł Sieniawski asked on 28 Oct 2015, 08:34 AM

Hello,

 I'm having problem with serverside filtering using autocomplete. Due to fact that Autocomplete is still unavailable at MVC Wrapper for ASP.NET 5 MVC 6, im using following code to initialize autocomplete: 

<script>
    var dataSource = new kendo.data.DataSource({
        serverFiltering: true,
        serverOperation: true,
        type: "aspnetmvc-ajax",
        transport: {
            read: {
                url: "@Url.Content("~/api/Get")",
                type: "GET"
            }
        },
        schema: {
            data: "Data",
            total: "Total"
        }
    })
 
    $("#@Model.Name").kendoAutoComplete({
        placeholder: "@Model.Watermark",
        minLength: 3,
        filter: "contains",
        dataSource: dataSource
 
    });
</script>

 As the result Query string that is send to server always looks like this : ?sort=&group=&filter= and because of that mapping to DataSourceRequest on serverside always results with empty filters

 

 

 

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 30 Oct 2015, 09:41 AM
Hello,

You should set the autocomplete dataTextField option in order for the widget to filter the dataSource.

Regards,
Daniel
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Paweł Sieniawski
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or