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

ComboBox Width

2 Answers 136 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
U
Top achievements
Rank 1
U asked on 23 Jun 2012, 05:54 AM
I am trying out the ComboBox widget in our product. We already have html pulldowns and I am generating the comboBox from the existing pulldowns, seems to work great but with a fixed width by default. I figured out a way to initialize the comboBox with correct width I want, $("#mypulldown").width(computedWidth).kendoComboBox(). This works well too, but when the pulldown values are updated/changed comboBox width remains same. How do I get the width updated to correct size?
Here is the link to jsfiddle,
http://jsfiddle.net/vzwaC/

Thanks
Uma

2 Answers, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 27 Jun 2012, 03:23 PM
Hi Uma,

Actually, the scenario you are trying to implement demand a non standard behavior of the select element. By design, when the select element is rendered it takes a width needed for the longest option to show. When the pulldown values are updated/changed the comboBox width remains same. In order to avoid this and get the width updated to correct size, you need to implement a custom logic and loop through all the options and get their width (count the symbols, check the font size etc.). 


Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
U
Top achievements
Rank 1
answered on 28 Jun 2012, 04:26 AM
We got it working by removing the style attribute in the underlying select, before getting the width second time.
Here is the updated fiddle, http://jsfiddle.net/vzwaC/2/
--Uma
Tags
ComboBox
Asked by
U
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
U
Top achievements
Rank 1
Share this question
or