首页 > 解决方案 > 如何显示 SearchFilter 文本框,即使 Angular Multiselect Dropdown 中没有加载数据

问题描述

角度版本:8

ng-multiselect-dropdown 版本:^0.2.10

就我而言,用户能够开始在搜索字段中输入以将结果动态加载到下拉列表中。但是在 ng-multiselect-dropdown 搜索框中要可见,至少需要一行数据。有没有办法始终显示搜索过滤器,无论数据是否可用。

this.dropdownList = [];

  this.dropdownSettings= {
  singleSelection: false,
  idField: 'item_id',
  textField: 'item_text',
  selectAllText: 'Select All',
  unSelectAllText: 'UnSelect All',
  itemsShowLimit: 3,
  allowSearchFilter: true
};

在此处输入图像描述

标签: angularangular8ng-dropdown-multiselect

解决方案


我迟到了,但是如果有人再次遇到相同的问题,这可能会很有用。添加allowRemoteDataSearch:true到您的下拉选项中。

你可以参考这个线程

https://github.com/NileshPatel17/ng-multiselect-dropdown/issues/182


推荐阅读