【问题标题】:Change dropdown popup height in Kendo for Angular在 Kendo for Angular 中更改下拉弹出高度
【发布时间】:2018-10-03 03:12:38
【问题描述】:

在这个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-ui kendo-ui-angular2


    【解决方案1】:

    我找到了答案here。您必须设置listHeight 属性。

    <kendo-dropdownlist 
        [data]="listItems"
        [popupSettings]="{
            width: 100,
            height: 30 }" 
        [listHeight]="500">
    </kendo-dropdownlist>
    

    【讨论】:

      【解决方案2】:

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

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

      max-height 更改为k-list-scroller

      【讨论】:

      • 请看StackBliz,更改 k-list-scroller 不起作用
      猜你喜欢
      • 2011-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多