Only request data the first time

3 posts, 1 answers
  1. Vinicius
    Vinicius avatar
    22 posts
    Member since:
    Apr 2007

    Posted 13 Dec 2011 Link to this post

    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. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 16 Dec 2011 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Vinicius
    Vinicius avatar
    22 posts
    Member since:
    Apr 2007

    Posted 16 Dec 2011 Link to this post

    Perfect! Thank you!
Back to Top