Services to globally set icon, toolPanel, gridOptions and localeText on all NG Grids in a solution.
The Servoy NG Grid Services can be used on NG Grids v2.0.0-rc4 and up.
There are 2 services, one for the NG Power Grid: plugins.ngPowerGrid, and one for the NG Data Grid: plugins.ngDataGrid. They both have the same config options that you can set: iconConfig, toolPanelConfig, gridOptions and localeText. Please note that these must be set before showing the grids, like onSolutionOpen, or onLoad of a form.
Usually a config can be set in 3 places:
- on the table component as a design property, if exposed (ex. rowHeight)
- as a config option applied on the table component (ex. gridOptions design time property with rowHeight)
- as a global config option applied using NG Grid services (ex. plugins.ngDataGrid.gridOptions with rowHeight) The order they are read is 2 - 3 - 1, for NG-Grid lower then v2.5.0, and 1 - 2 - 3 for v.2.5.0 and higher : if option is set on component config, that is used, else if global config is set then that will be used, otherwise, if the option is not set in any config, the design time value of that option will be used.
- iconConfig
Used to customize the icons of the grids. There is a helper api function to create an iconConfig, that can be usefull as it has predefined icon keys, ex. plugins.ngDataGrid.createIconConfig
- toolPanelConfig
Used to customize the tool panel of the grids. There is a helper api function to create an toolPanelConfig, that can be usefull as it has predefined tool panel option keys, ex. plugins.ngDataGrid.createToolPanelConfig
- gridOptions
Used to customize any options that ag-Grid exposes. Check here for available options: https://www.ag-grid.com/javascript-grid-properties/
- localeText
Used for internationalisation. Check here for available options: https://www.ag-grid.com/javascript-grid-internationalisation/
- columnOptions
Used to customize the properties of the columns. Check here for available options: https://www.ag-grid.com/javascript-grid-column-properties/
- mainMenuItemsConfig
Used to customize the main menu items of the grids. There is a helper api function to create a mainMenuItemsConfig, that can be usefull as it has predefined main menu items keys, ex. plugins.ngDataGrid.createMainMenuItemsConfig
- arrowsUpDownMoveWhenEditing (only for NG Data Grid)
Defines action on TEXTFIELD editor for up/down arrow keys. Can be one of the followings: NONE - editor's caret moves to start/end, NEXTCELL - starts editing the cell from the previos/next row, same column, if editable, else it just selects the row, NEXTEDITABLECELL - starts editing the cell from the first editable previous/next row, same column.
- editNextCellOnEnter (only for NG Data Grid)
If start editing next cell on ENTER (when in TEXTFIELD editor).
Found a bug or would like to see a new feature implemented? Raise an issue in the Issue Tracker
Eager to fix a bug or introduce a new feature? Clone the repository and issue a pull request
Servoy NG Grid Services is licensed under the MIT license. You can freely use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies for the content of this repository.