Autocomplete data-role...and Focusout

4 posts, 0 answers
  1. tram
    tram avatar
    9 posts
    Member since:
    Jan 2021

    Posted 05 Feb Link to this post

    Hi All,

    I am new to Kendo, can you please help me with the below scenario.

    In the current scenario, when I enter 3 letters, the call is going to the database, but I want to call database only when I focus out of the textbox , I don't want to call database after 3 letters. how to achieve this, below is my code block.

     

    (function ($, kendo, undefined) {
    var templates = {
    description:
    '<input data-role="autocomplete" type="text" data-text-field="description" data-filter="contains" data-min-length="3" data-bind="source: colors, value: autoCompleteValue/>'
    };

    var seceditor = Widget.extend(
    options: {
    columns: [
      { 
        template: kendo.template(templates.description)
      }
    ]
    });
    ui.plugin(seceditor );
    })(jQuery, window.kendo);

     

    Thanks,

    Tram

  2. tram
    tram avatar
    9 posts
    Member since:
    Jan 2021

    Posted 07 Feb in reply to tram Link to this post

    Hi All,

    Can some one please help me.

    Thanks,

    Tram

  3. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2184 posts

    Posted 09 Feb Link to this post

    Hi Tram,

    The behavior you are after is not supported by the AutoComplete. The problem with it is that to prevent the request to the server from being sent when typing text you will have to prevent the filtering event. However, it is tied to showing the results in the dropdown, so preventing it and sending the request on focusout will lead to the popup not opening.

    Regards,
    Ivan Danchev
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  4. tram
    tram avatar
    9 posts
    Member since:
    Jan 2021

    Posted 11 Feb in reply to Ivan Danchev Link to this post

    Hi Ivan,

    Thank You so much.

    Regards,

    Tram

Back to Top