-2

我有一个角度应用程序,它有很多使用 DxDataGrid 的组件,它们都有相同的默认选项。是否可以在任何设置文件或类似文件的某处设置默认选项?

4

1 回答 1

1

使用 dxDataGrid.defaultOptions 方法为所有 DataGrid 小部件设置默认配置选项。此方法是静态的,您可以在主组件的构造函数中调用它。

export class AppModule {  
  constructor() {  
    DataGrid.defaultOptions({  
      options: {  
        showRowLines: true,  
        showColumnLines: false,  
        rowAlternationEnabled: false,  
        focusedRowEnabled: true,  
        allowColumnResizing: true,  
        noDataText: "",  
        scrolling: {  
          mode: "virtual"  
        },  
        sorting: {  
          mode: "single"  
        },  
        loadPanel: {  
          enabled: false  
        }
      }  
    });  
  }  
}

https://www.devexpress.com/Support/Center/Question/Details/T738119/datagrid-how-to-define-default-configuration-options-for-angular-components

从 DevExtreme 支持中回答了这个问题

于 2019-11-12T13:03:01.670 回答