Last Updated: 19 Mar 2019 08:49 by ADMIN
Created on: 12 Mar 2019 09:25
Category: ComboBox
Type: Feature Request
Support a tag template for ComboBox

I would like to be able to render the selected item for a ComboBox with a template which could be called kendoComboBoxTagTemplate so that I can render it as a hyperlink. This feature would provide similar functionality to the MultiSelect kendoMultiSelectTagTemplate.

I had considered doing a bit of a hack by using the MultiSelect and only allowing a single selection but this is nasty as you will still get the selected value as an item in an array. It would be much better if the tag template functionality was provided for ComboBox.


1 comment
Dimiter Topalov
Posted on: 19 Mar 2019 08:49
Hi Graham,

I am afraid that we will have to decline this feature request for the following reasons: the ComboBox component's Input element is both holding the value, and is editable for searching and adding custom values purposes by design, displaying different customized or templated values and/or nested elements is not possible. The conceptual design of the ComboBox (as opposed to the one of the MultiSelect) does not allow the displayed Input value to differ from the actual component value. I hope this makes sense.

If a MultiSelect-like UI is a must (where there are separate elements holding the selected tags, and the search area input), you can indeed customize the MultiSelect to restrict it to single values, and utilize its Tag template. Having to extract the single value from the array that represents the component's value is indeed an additional overhead, but does not seem like a very big one, as you will be guaranteed that the actual value is always the only/zero-indexed element of the array.

The most convenient approach seems to be to create a custom wrapper component with a MultiSelect with the custom logic for allowing a single value only, inside, and some additional logic that will handle passing non-array values from the outside as an @Input, and internally handling wrapping this passed value to an array the MultiSelect can be value-bound to, and later exposing the extracted single value from this array to the outside world as the custom wrapper component's value.

I hope this makes sense.

Dimiter Topalov
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.