在Kendo for Angular中更改下拉弹出窗口的高度

时间:2018-10-03 03:12:38

标签: kendo-ui kendo-ui-angular2

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

@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);
    }

}

1 个答案:

答案 0 :(得分:1)

如果您可以检查浏览器中的元素,则会看到Kendo为下拉列表生成div

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

max-height类的k-list-scroller更改为

相关问题