EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: mzeddd on September 11, 2014, 04:57:56 AM



Title: drop-down panel size on combobox
Post by: mzeddd on September 11, 2014, 04:57:56 AM
Is it possible to make EasyUI to adapt panel size to number of items?

I do not set any parameters for the panel but all the time I have the same size to feet about 10-11 items.
It is OK if I have 10-11 items, but it does not look good if I have just 3-4.
I see this when my combobox is created via HTML.



Title: Re: drop-down panel size on combobox
Post by: stworthy on September 11, 2014, 07:03:05 AM
Please try to set the 'panelHeight','panelMinHeight' and 'panelMaxHeight' properties.
Code:
$('#cc').combobox({
  panelHeight:'auto',
  panelMinHeight:100,
  panelMaxHeight:200
});


Title: Re: drop-down panel size on combobox
Post by: mzeddd on September 11, 2014, 10:19:55 PM
Thanks.

Code:
panelHeight:'auto'
is enough to solve my problem.

How can I apply this parameter for all combo elements on the page?


Title: Re: drop-down panel size on combobox
Post by: stworthy on September 11, 2014, 10:51:42 PM
Override the $.fn.[plugin].defaults.panelHeight. Please try the code below:
Code:
<script>
$.map(['combo','combobox','combogrid','combotree','datebox','datetimebox'], function(plugin){
$.fn[plugin].defaults.panelHeight = 'auto';
});
</script>


Title: Re: drop-down panel size on combobox
Post by: mzeddd on September 12, 2014, 02:54:52 AM
thanks!