Autocomplete serverfiltering

2 posts, 0 answers
  1. Paweł Sieniawski
    Paweł  Sieniawski avatar
    1 posts
    Member since:
    Oct 2009

    Posted 28 Oct 2015 Link to this post

    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

     

     

     

  2. Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 30 Oct 2015 Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top