RevoGrid Documentation

repository·main·Indexed 25 days ago

https://github.com/revolist/revogrid

A high-performance, lightweight virtual reactive data grid spreadsheet component built with StencilJS. RevoGrid supports rendering millions of rows and cells via virtualization and an intelligent Virtual DOM. It features Excel-like interactions, RTL support, multi-column filtering, pinned rows/columns, and a plugin system. It provides native integrations for Vue, React, Angular, Svelte, and Vanilla JavaScript, with specialized packages like @revolist/angular-datagrid for Angular projects.

Tokens
16.8K
Snippets
34
Records
89
Agent score
85%

What's inside RevoGrid

  1. Overview of RevoGrid features

    main

    RevoGrid is a high-performance data grid component built with StencilJS. It is designed to handle massive datasets, capable of rendering over 1 million rows and millions of cells efficiently through virtualization.

    Core Capabilities:

    • High Performance: Uses an Intelligent Virtual DOM and Virtual Scroll to keep the DOM focused on the visible viewport, allowing for millions of cells without a hard row limit.
    • Accessibility & RTL: Follows WAI-ARIA best practices and provides comprehensive Right-to-Left (RTL) support for languages like Arabic and Hebrew.
    • Data Manipulation: Supports sorting, multi-column filtering (including conditional and custom filters), and drag-and-drop for both rows and columns.
    • Advanced Layout: Features pinned/sticky/freezed columns and rows, column/row grouping (including nested headers and drill-down), and column resizing.
    • Extensibility: Includes a plugin system, support for custom cell templates, editors, and header templates, and modern VNode/tsx support.
    • Excel-like Experience: Provides keyboard navigation, seamless copy/paste from Excel/Google Sheets, and various column types (Text, Number, Select, Date).
  2. Explore RevoGrid Key Features

    main

    RevoGrid is a high-performance data grid designed for large datasets (1M+ rows) using virtualization and an intelligent Virtual DOM. Key capabilities include:

    • Data Handling: Virtual scrolling, sorting, multi-column filtering, and row/column grouping (including nested headers and drill-down).
    • Interactivity: Drag and drop for rows/columns, Excel-like keyboard navigation, and range operations (selection and autofill).
    • Layout: RTL support, pinned/sticky columns (left/right) and rows (top/bottom), and automatic/custom column and row sizing.
    • Customization: Extensive templating for column headers, row headers, and cell renderers/editors, plus support for various themes (Excel-like, Material).
    • Extensibility: A plugin system and support for modern VNode/tsx features.
    • Exporting: Built-in CSV export, PDF export via plugin, and Excel export (Pro version).
  3. Framework integrations for RevoGrid

    main

    RevoGrid provides native support and full type support for several frameworks via a Continuous Delivery system. Supported frameworks include:

    • Vue: Vue 2 and Vue 3
    • React
    • Angular
    • Svelte
    • Python: Dash / Python
    • Vanilla JavaScript
  4. Explore RevoGrid Pro Features

    main

    RevoGrid Pro extends the core grid with production-ready plugins designed for advanced data entry, analytics, layout, validation, remote data workflows, and enterprise planning. Key capability areas include:

    • Advanced Data Structures: Hierarchical tree views and Row Transpose (vertical form-like view).
    • Complex Headers & Columns: Multi-level/nested headers, column grouping, drill-down (collapse/expand), and autosizing.
    • Remote Data Workflows: Server-side loading with infinite scroll, pagination, and server-side grouping/aggregation.
    • Data Management: Audit trails, undo/redo history, Excel import/export (xlsx, xlsm, xlsb, xls), and smart auto-fill.
    • Advanced Selection: Multi-range selection, row checkbox selection, and advanced drag-and-drop.
    • Filtering & Search: Cascading filters, slider-based numeric filtering, and header-based input filtering.
    • Formula Engine: Excel-like formulas with cell references, a formula bar, and dependency highlighting.
    • Data Visualization: In-cell charts (sparklines, bar charts, etc.), heatmaps, and conditional formatting.
    • Specialized Editing: Dynamic form editing, specialized editors (sliders, counters, timelines, dropdowns), and cell validation.
    • Enterprise Tools: Pivot Tables for multidimensional analytics and Gantt/Scheduling for project planning.
    • AI Integration: AI Agent support for generating plugins and configurations, and RevoGrid MCP for AI-native intelligence.
  5. Extend RevoGrid with Custom Templates and Editors

    main

    RevoGrid is highly customizable through its VNode and plugin architecture. You can customize the following elements:

    • Column header template: Modify how column headers appear.
    • Row header template: Modify row headers.
    • Cell properties: Define custom properties for rendered cells.
    • Cell template: Create custom cell views (renderers).
    • Cell editor: Use predefined editors or apply your own custom editors and cell types.
  6. Implement RevoGrid in a Vue 3 component

    main

    Import the Grid component and helper functions from @revolist/vue3-datagrid to render the grid. You can pass source (data), columns (configuration), and editors (custom editor registry) as props. The component supports events like @cell-click and @cell-custom-action.

    <template>
        <Grid
          :editors="gridEditors"
          :source="source"
          :columns="columns"
          @cell-custom-action="testCustomCellAction"
          @cell-click="testAction"
        />
    </template>
    
    <script lang="ts" setup>
    import Grid, { VGridVueEditor, VGridVueTemplate, Editors } from '@revolist/vue3-datagrid';
    
    const MY_EDITOR = 'custom-editor';
    
    // Register custom editors
    const gridEditors: Editors = { [MY_EDITOR]: VGridVueEditor(Editor) };
    
    const columns = [
      {
        prop: 'name',
        name: 'First',
        editor: MY_EDITOR,
        cellTemplate: VGridVueTemplate(Cell),
      },
      {
        prop: 'details',
        name: 'Second',
      },
    ];
    
    const source = [
      { name: '1', details: 'Item 1' },
      { name: '2', details: 'Item 2' },
    ];
    
    function testCustomCellAction(e: CustomEvent) {
      console.log('Custom cell action', e);
    }
    function testAction(e: CustomEvent) {
      console.log('Editor action', e);
    }
    </script>
  7. Migrate from RevoGrid v3 to v4

    main

    Version 4.0 introduced several breaking changes, primarily focused on type support, event naming, and viewport type names.

    Type Support Changes

    Deprecated namespaces have been removed. Instead of using RevoGrid.ColumnRegular, use ColumnRegular directly.

    Importing types:

    • Before: import { RevoGrid } from '@revolist/revogrid/dist/types/interfaces'
    • Now: import { ColumnRegular } from '@revolist/revogrid'

    Viewport Type Renaming

    Viewport type names have changed. For example, when defining rowDefinitions, change the type property:

    • Before: { type: "row", ... }
    • Now: { type: "rgRow", ... }

    Event Naming Convention

    All event names have been updated to be entirely lowercase to align with modern naming conventions.

    • Example: afterEdit is now afteredit.
    • Note: beforerowrender now returns a BeforeRowRenderEvent object. Review all event usage in your codebase.
  8. Implement RevoGrid in Vue 2

    main

    To implement the grid, import the VGrid component and bind the :source (data rows) and :columns (column definitions) props. You can also use VGridVueTemplate to inject custom Vue components as cell templates.

    <template>
      <!-- Use the VGrid component and bind the data source and columns -->
      <v-grid :source="rows" :columns="columns" />
    </template>
    
    <script>
    import Grid, { VGridVueTemplate } from '@revolist/vue-datagrid';
    import Cell from './Cell.vue';
    
    export default {
      name: 'App',
      data() {
        return {
          columns: [
            { prop: 'name', name: 'First' },
            { prop: 'details', cellTemplate: VGridVueTemplate(Cell) },
          ],
          rows: [{ name: '1', details: 'Item 1' }],
        };
      },
      components: {
        VGrid,
      },
    };
    </script>
  9. Use RevoGrid in Angular Standalone Components

    main

    In Angular v17+ standalone projects, import RevoGrid and add it to your component's imports array. You can then use the <revo-grid> selector in your template. Use the [source] property for data, [columns] for column definitions, and [editors] to register custom editors.

    import { Component } from "@angular/core";
    import { RevoGrid, Template, Editor, Editors, ColumnRegular } from "@revolist/angular-datagrid";
    import { CellComponent } from './cell.component';
    import { EditorComponent } from './editor.component';
    
    const MY_EDITOR = 'custom-editor';
    
    @Component({
      selector: 'app-root',
      standalone: true,
      imports: [RevoGrid, CellComponent, EditorComponent],
      template: `<revo-grid [source]="source" [columns]="columns" [editors]="editors"/>`,
    })
    export class AppComponent {
        source = [
        {
          name: "1",
          details: "Item 1",
        },
        {
          name: "2",
          details: "Item 2",
        },
      ];
      columns: ColumnRegular[] = [
          {
            prop: 'name',
            name: 'First',
            editor: MY_EDITOR,
            cellTemplate: Template(CellComponent),
          },
          {
            prop: 'details',
            name: 'Second',
          },
      ];
      editors: Editors = { [MY_EDITOR]: Editor(EditorComponent) };
    }