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

Keep Multiselect dropdown list open at fixed height with vertical scroll

1 Answer 628 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Jamie
Top achievements
Rank 1
Jamie asked on 07 Apr 2016, 06:16 PM

Would anyone have suggestions on how to keep a Multiselect dropdown list open at a fixed height with vertical scroll.

We have a series of Multiselects, and our visual design calls for them to all stay open. They'll be populated with dynamically which will make the length constantly vary, so they'll need to stay open, stay at a fixed height, and be scrollable when they extend beyond the fixed height.

Can this be done with simple styling, or would some JS be the way to go?

 

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 11 Apr 2016, 11:46 AM

Hello Jamie,

You can utilize the close and dataBound events of the Kendo UI MultiSelect. In the handler of the former, prevent the triggering of the default action. In the handler of the latter set the height of the widget's dropdown (200px is the default maximum height, after which a vertical scrollbar appears automatically), and call the open() method:

$("#multiselect").kendoMultiSelect({
close: function(e){
e.preventDefault();
},
dataBound: function(e){
if(e.sender.ul.height() < 200){
e.sender.ul.height(200);
}
           
e.sender.open();
}
});

Let me know if you need further assistance.

 

Regards,
Dimiter Topalov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
MultiSelect
Asked by
Jamie
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or