What happens with *a lot* of records in the back end?

2 posts, 0 answers
  1. Andrea
    Andrea avatar
    11 posts
    Member since:
    Apr 2009

    Posted 06 Jun 2013 Link to this post

    I'm making tests, on selecting a customer from a database, and binding the combobox value to the model.
    All is ok, but I'm wondering about the fact that I can open the combobox dropdown even without typing any text: what happens if I have, say, a million records? I would like to give the chance to the user to open the drop down only if I have, say, three chars typed in...
    Thanks
    Andrea
  2. jerome
    jerome avatar
    2 posts
    Member since:
    May 2013

    Posted 08 Jun 2013 Link to this post

    Hi Andrea,

    You can use minLength and attach a function to the Open event :
    Here is an exemple for three chars :
    @(Html.Kendo().ComboBox().Name("Combo")
                                .BindTo(new List<string>()
                                    {"banana", "apple", "orange"}
                                )
                                .Suggest(true)
                                .MinLength(3)
                                .Placeholder("...")
                                .Events(e => e.Open("onOpen"))
    )
    function onOpen(e) {
        if (e.sender.text().length < 3) {
            e.preventDefault();
        }
    }
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top