简体   繁体   中英

Set default options of DxDataGrid

I have an angular application which has a lot of components using DxDataGrid, all of them have the same default options. Is it possible to set the default options somewhere at any settings file or something similar?

Use the dxDataGrid.defaultOptions method to set default configuration options for all DataGrid widgets. This method is static and you can call it in a constructor of the main component.

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

Answered in this question from DevExtreme support

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM