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

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

1 Answer 22 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Andrea
Top achievements
Rank 1
Andrea asked on 06 Jun 2013, 08:58 AM
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

1 Answer, 1 is accepted

Sort by
0
jerome
Top achievements
Rank 1
answered on 08 Jun 2013, 03:37 PM
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();
    }
}
Tags
ComboBox
Asked by
Andrea
Top achievements
Rank 1
Answers by
jerome
Top achievements
Rank 1
Share this question
or