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

Only request data the first time

2 Answers 66 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Vinicius
Top achievements
Rank 1
Vinicius asked on 14 Dec 2011, 03:36 AM
I have added this code to try KendoAutoComple, but it only looks for data on the server the first time. What am I missing?

$('#autoCompletar').kendoAutoComplete({
    minLength: 3,
    dataTextField: 'Nome',
    filter: 'contains',
    dataSource: new kendo.data.DataSource({
        transport: {
            read: {
                dataType: "json",
                url: "/Home/PesquisarPessoas",
                data: {
                    q: function () { return $('#autoCompletar').val(); },
                    limite: 10
                }
            }
        }
    })
});

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 16 Dec 2011, 10:40 AM
Hello Vmrocha,

 
By default the datasource, which the autocomplete uses, uses local filtering, paging, sorting and etc. of the data. In order to achieve your goal you will need to set the serverPaging and serverFiltering options to true. Check this online demo for more information.

Greetings,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Vinicius
Top achievements
Rank 1
answered on 16 Dec 2011, 11:22 AM
Perfect! Thank you!
Tags
AutoComplete
Asked by
Vinicius
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Vinicius
Top achievements
Rank 1
Share this question
or