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

Datasource Filters Cleared on AutoComplete Search

2 Answers 145 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 13 Aug 2012, 06:07 PM
When I set a filter on the datasource used by my autocomplete widget, the filter seems to be cleared the moment you search inside the autocomplete. Is there a way to override this functionality? I have a grid that I am filtering in several different ways and I want the autocomplete data to be updated to show these other filters. Code can be found below.

    var ds = new kendo.data.DataSource({data: createRandomData(50)})

    //create AutoComplete UI component
    var autoComplete = $("#input").kendoAutoComplete({
        dataSource: ds,
        dataTextField: 'FirstName',
        filter: "startswith",
        placeholder: "Search by First Name..."
    });
    var grid = $('#grid').kendoGrid({
        dataSource: ds,
        columns: [
            {field: 'FirstName', title: 'First Name'}
        ]
    });
    
    ds.filter([{ field: "FirstName", operator: "contains", value: "La" }]);

The filter I manualy add in is automatically removed the moment I begin typing inside the autocomplete where instead I want to simply add an additional filter using the autocomplete. Any help is appreciated.

Thanks

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 16 Aug 2012, 11:50 AM
Hello Brad,

 Indeed when the data source is shared filtering the combobox would filter the grid as well. If this is not wanted you may consider using two separate datasources.

All the best,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Chris
Top achievements
Rank 1
answered on 28 Aug 2012, 07:46 PM
THANKS FOR SHARING THE DETAIL.



http://www.amazon.ca/Raspberry-Ketones-Keytones-Serving-Capsules/dp/B0080R7XR8/








Tags
AutoComplete
Asked by
Brad
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Chris
Top achievements
Rank 1
Share this question
or