A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.ag-grid.com/javascript-data-grid/component-loading-cell-renderer/ below:

JavaScript Grid: Loading Component | AG Grid

The Loading Component is displayed for a row to show data is loading.

Full Width Loading Row Copy Link

The example below demonstrates replacing the Provided Loading Component with a Custom Loading Component.

Custom Loading Row Copy Link

The interface for the loading cell renderer component is as follows:

interface ILoadingCellRendererComp {
    
    init(params: ILoadingCellRendererParams): void;

    
    getGui(): HTMLElement;
}

The interface for the loading cell renderer parameters is as follows:

Properties available on the ILoadingCellRendererParams<TData = any, TValue = any, TContext = any> interface.

Failed Loading Copy Link

When using a Custom Loading Component, you can add handling for loading failures in the component directly.

In the example below, note that:

Dynamic Loading Row Selection Copy Link

It's possible to determine what Loading Cell Renderer to use dynamically - i.e. at runtime. This requires providing a loadingCellRendererSelector.

loadingCellRendererSelector: (params) => {
    const useCustomRenderer = ...some condition/check...
    if (useCustomRenderer) {
        return {
            component: CustomLoadingCellRenderer,
            params: {
                
                loadingMessage: '--- CUSTOM LOADING MESSAGE ---',
            },
        };
        } else {
            
            return undefined;
        }
    }
}
Skeleton Loading Copy Link

The grid can be configured to instead display loading indicators in cells, by enabling suppressServerSideFullWidthLoadingRow.

const gridOptions = {
    suppressServerSideFullWidthLoadingRow: true,
};
Custom Loading Cells Copy Link

The default grid behaviour can be overridden in order to provide renderers on a per-column basis.

const gridOptions = {
    suppressServerSideFullWidthLoadingRow: true,
    columnDefs: [
        { field: 'athlete', loadingCellRenderer: CustomLoadingCellRenderer },
        
    ],
    defaultColDef: {
        loadingCellRenderer: () => '',
    },
};

The above example demonstrates the following:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4