首页 > 解决方案 > 在 Kendo for Angular 中更改下拉弹出高度

问题描述

在这个StackBliz 中,我有一个 Kendo for Angular 下拉列表。当您打开下拉菜单时,弹出窗口会显示七个项目。我只想展示三个项目。所以我将高度设置popupSettings为 30,但剑道忽略了它。如何更改弹出高度?

@Component({
  selector: 'my-app',
  template: `
      <kendo-dropdownlist 
         [data]="listItems"
         [popupSettings]="{
            width: 100,
            height: 30 }">
      </kendo-dropdownlist>
  `
})
export class AppComponent {
    public listItems: Array<string> = [];

    ngOnInit(){
         for(var i=1;i<=100;i++)
            this.listItems.push('Item ' + i);
    }

}

标签: kendo-uikendo-ui-angular2

解决方案


div如果您可以检查浏览器上的元素,您将看到 Kendo 为下拉菜单生成一个。

<div unselectable="on" class="k-list-scroller" style="max-height: 200px;">

更改max-heightfor 类k-list-scroller


推荐阅读