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

Combobox server filtering and virtualization

2 Answers 284 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Dan asked on 03 Oct 2018, 02:00 PM

I have an old application where the user was entering an input a dropdown list (of multiple values concatenated) was displayed and he could filter the list based on the values displayed.

Now we decided to use Combobox since the Autocomplete does not open the dropdown when the autocomplete receives focus. Since the list contains too many values I though I should try also virtualization

@(Html.Kendo().ComboBox()
   .Name("deviceclassselection")
   .HtmlAttributes(new { @class = "form-control s-device-class" })
   .DataSource(dataSource => dataSource.Ajax()
                           .Read(read => read.Action("GetDeviceClasses", "Device").Data("device.getDeviceClassAdditionalData"))
                           .PageSize(40)
                           .Events(events => events.Error("device.dataSourceError")))
   .Template("#= data.Designation # - #= data.Manufacturer # - #= data.Model #")
   .Height(200)
   .Events(events => events.Select("device.deviceClassSelect"))
   .Virtual(v => v.ItemHeight(26).MapValueTo("dataItem"))
   .Deferred()
)

However when I write something in the combobox no event is triggered on the server. If I open the dropdown manually the server is called.

I tried removing the Virtual and the result was the same (Probably it did not worked because I left the Ajax and the PageSize).

2 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 05 Oct 2018, 10:15 AM
Hello Dan,

Could you please enable the serverPaging of the widget. you could take a look of the configuration of the ComboBox in the Virtualization Demo linked here
For convenience I am attaching a sample project where the virtualization of the ComboBox is enabled. when the user types in the input field, a request is sent to the remote server.
In addition, I would suggest you to refer to the article regarding virtualization, as it could be helpful. 

Regards,
Neli
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 05 Oct 2018, 10:20 AM

Hi Neli,

Thank you for responding to me. After some investigation I managed to figure out why it was not working. I forgot to add the Filter(FilterType.Contains) and also the thing you suggested with the ServerOperation(true). After I did this the combobox started to behave as expected.

Tags
ComboBox
Asked by
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Neli
Telerik team
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or