Vue Data Grid: Overlay Component
Overlay components allow you to add your own overlays to AG Grid. Use these when the provided overlays do not meet your requirements.
Simple Loading Overlay Component
Below is a simple example of an loading overlay component:
const MyOverlay = {
template: `
<div class="ag-overlay-loading-center" style="background-color: lightsteelblue;">
<i class="fas fa-hourglass-half"> {{ params.loadingMessage }} </i>
</div>
`
}Simple No-Rows Overlay Component
Below is a simple example of a no-rows overlay component:
const MyOverlay = {
template: `
<div class="ag-overlay-loading-center" style="background-color: lightcoral;">
<i class="far fa-frown"> {{params.noRowsMessageFunc()}}</i>
</div>
`
}Example: Custom Overlay Components
The example below demonstrates how to provide custom overlay components to the grid. Notice the following:
- Custom Loading Overlay Renderer is supplied by name via
gridOptions.loadingOverlayComponent. - Custom Loading Overlay Renderer Parameters are supplied using
gridOptions loadingOverlayComponentParams. - Custom No Rows Overlay Renderer is supplied by name via
gridOptions.noRowsOverlayComponent. - Custom No Rows Overlay Renderer Parameters are supplied using
gridOptions.noRowsOverlayComponentParams.
Overlay Component Interface
Any valid Vue component can be an Overlay. When a custom Overlay Component is instantiated within both a template and the Grid API will be made available on this.params:
Loading Overlay Params Interface
interface ILoadingOverlayParams {
// The grid API
api: GridApi;
}No Rows Overlay Params Interface
interface INoRowsOverlayParams {
// The grid API
api: GridApi;
}Registering Overlay Components
See the section registering custom components for details on registering and using custom overlays.
- Overlay Component
- Simple Loading Overlay Component
- Simple No-Rows Overlay Component
- Example: Custom Overlay Components
- Overlay Component Interfaces
- Loading Overlay
- No Rows Overlay
- Overlay Components Interfaces
- Loading Overlay
- No Rows Overlay
- Overlay Component Interface
- Overlay Component Interface
- Loading Overlay Params Interface
- No Rows Overlay Params Interface
- Registering Overlay Components