Combobox dropdown height

1 Answer 142 Views
ComboBox
FIMS Computing Services FIMS - UWO
Top achievements
Rank 1
FIMS Computing Services FIMS - UWO asked on 16 Jun 2022, 08:46 PM

Hi,

Is it possible to set the height of the combobox dropdown in JavaScript.

I can set it in the taghelper but I have the combobox beside another element on the page and I want to match the heights.

It seems to be that I should be able to set it in the open event for the combobox but I can't seem to get it to work.

Is there a property on the Combobox that I should change?

Changing the height on the data-role div seems to get overwritten.

Any suggestions?

Thanks,

Charlotte

 

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 21 Jun 2022, 11:40 AM

Hello Charlotte,

The change of the initial configuration options can be achieved via the setOptions method of the ComboBox. However, upon investigating the I found that the height is not reset, so I have logged an issue on the matter. 

That said, to achieve the desired behavior until the above issue is fixed I can suggest destroying and reinitializing the component with the desired height:

function onClick(){
        var cbx = $("#products").getKendoComboBox();
        var options = cbx.options;
        options.height = 1000;
        cbx.destroy();
        $("#products").kendoComboBox(options);
    }
Here is a sample REPL demonstrating this suggestion.

 

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

FIMS Computing Services FIMS - UWO
Top achievements
Rank 1
commented on 21 Jun 2022, 12:51 PM

Thanks! I would never have thought of that.

Charlotte

Tags
ComboBox
Asked by
FIMS Computing Services FIMS - UWO
Top achievements
Rank 1
Answers by
Aleksandar
Telerik team
Share this question
or