2

I have a Kendo UI autocomplete using the MVC helper:

@(Html.Kendo().AutoCompleteFor(m => m)
     .DataSource(dataSource => dataSource.Read(read => read.Action("CustomerNames_Read", "Wells")))
     .DataTextField("Name")
     .MinLength(3))

The MinLength works fine, only retrieving values when 3 letters are entered.

The problem is if you clear the box it retrieves all values (which in this instance is 1000+). How can I stop this?

The same behavior can be seen in the demo:

http://demos.telerik.com/kendo-ui/autocomplete/index

Enter a letter, such as 'b', then delete it - all values are retrieved.

gsharp
  • 27,557
  • 22
  • 88
  • 134
pfeds
  • 2,183
  • 4
  • 32
  • 48

1 Answers1

1

I've raised a support ticket at Telerik. The answer was that this is apparently by design because customers wanted it that way.

This can be prevented by implementing some JavaScript client side (see demo)

Since I'm not so happy whit the JavaScript approach I've raised a feature request, that extends the MinLenght like this

.MinLength(int length, bool triggerOnEmptyText = true)

not sure if it's going to be implemented yet, will update as soon as I get an answer.

UPDATE:

Got feedback from Telerik. They won't implement it unless it geht a high vot in the User Voice. So if you like the Feature pleae vote here!

gsharp
  • 27,557
  • 22
  • 88
  • 134