【问题标题】:DevExtream MultiSelect DropDown box Customize the AppearanceDevExtreme 多选下拉框自定义外观
【发布时间】:2021-02-28 08:49:39
【问题描述】:

在 Angular 10 中,我现在正在使用 devExtream 多选下拉框在下拉菜单中。

HTML部分

<div class="dx-field">
    <div class="dx-field-label">DropDownBox with embedded DataGrid</div>
    <div class="dx-field-value">
        <dx-drop-down-box
                [(value)]="gridBoxValue"
                valueExpr="ID"
                displayExpr="CompanyName"
                placeholder="Select a value..."
                [showClearButton]="true"
                [dataSource]="gridDataSource"
                (onValueChanged)="ValueChange($event)"
        >

            <div *dxTemplate="let data of 'content'">
                <dx-data-grid
                        [dataSource]="gridDataSource"
                        [columns]="['CompanyName']"
                        [selection]="{ mode: 'multiple' }"
                        [hoverStateEnabled]="true"
                        [paging]="{ enabled: true, pageSize: 10 }"
                        [filterRow]="{ visible: true }"
                        [scrolling]="{ mode: 'infinite' }"
                        [height]="345"
                        [(selectedRowKeys)]="gridBoxValue"
                >
                </dx-data-grid>
            </div>
        </dx-drop-down-box>
    </div>
</div> 

TS 文件

    **gridDataSource: any;
  
  gridBoxValue: number[] = [];
    constructor(http: HttpClient) {
      
        this.gridDataSource = this.makeAsyncDataSource(http);
       
    }

    makeAsyncDataSource(http) {
      return new CustomStore({
        loadMode: "raw",
        key: "ID",
        load: function() {
            return http.get("https://js.devexpress.com/Demos/WidgetsGallery/JSDemos/data/customers.json")
                .toPromise();
        }
    });
  }

  

  ValueChange(e)
  {
   debugger;
 
  }**

【问题讨论】:

    标签: angular devexpress devextreme devextreme-angular


    【解决方案1】:

    对于此功能,我建议您使用 tagBox(看起来像 dropDownBox,但功能不同)而不是 dropDownBox,但如果您出于某种原因需要,您应该尝试在内容数据中添加一个复选框。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多