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

AutoComplete with remote DataSource "contains" filter

2 Answers 820 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
John Thompson
Top achievements
Rank 2
John Thompson asked on 24 Dec 2012, 12:06 AM
I there a way to create a remote DataSource for an AutoComplete that uses "contains" instead of "startswith"?  I tried specifying the filter like so:

$("#SearchFor").kendoAutoComplete({
        minLength: 2,
        dataTextField: "FullText",
        dataSource:
            {
                type: "json",
                serverFiltering: true,
                serverPaging: true,
                pageSize: 20,
                filter:
                    {
                        field: "FullText",
                        operator: "contains",
                        value: $("#SearchFor").val()
                    },
                schema:
                    {
                        data: "data",
                        count: "count"
                    },
                transport:
                    {
                        read: applicationPath() + "/Home/SearchForStuff"
                    }
            }
        });

but, it was changed/overridden by the component on the AJAX request.

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 25 Dec 2012, 11:21 AM
Hi John,

Please use the filter option of the AutoComplete.

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
John Thompson
Top achievements
Rank 2
answered on 25 Dec 2012, 02:23 PM
Charmingly simple!  Thanks and Merry Christmas!
Tags
AutoComplete
Asked by
John Thompson
Top achievements
Rank 2
Answers by
Alexander Valchev
Telerik team
John Thompson
Top achievements
Rank 2
Share this question
or