DEV Community

Cover image for How to Choose a React Grid Component: 12 Features Enterprise Apps Need
Vishal Porwal
Vishal Porwal

Posted on

How to Choose a React Grid Component: 12 Features Enterprise Apps Need

A React data grid enterprise can start as a simple table and become one of the most important parts of an enterprise application.
Initially, sorting and filtering may be enough. As the application grows, users may expect grouped summaries, editable cells, locked columns, Excel export, pivot tables, and responsive scrolling through hundreds of thousands of records.
Selecting the right grid early can reduce the amount of custom functionality your team must implement and maintain.
This guide covers 12 features worth evaluating and shows how ReExt brings Ext JS grid capabilities into React.

  1. Performance with Large Datasets
    Look for virtual or buffered rendering that limits the number of rows rendered in the DOM.
    Test the grid using production-like data and your actual column count. Measure initial rendering, scrolling, and updates rather than relying on a small demo.
    With ReExt, the Ext JS grid provides buffered rendering, and buffered stores can request remote data in blocks.

  2. Server-Side Sorting, Filtering, and Pagination
    For large datasets, the browser shouldn't need to download every record before users can work with the data.
    Your grid should send sorting, filtering, and pagination requests to the backend and display the returned records and total count.
    A simplified ReExt store configuration looks like this:

const ordersStore = {
  pageSize: 100,
  remoteSort: true,
  remoteFilter: true,
  proxy: {
    type: "ajax",
    url: "/api/orders",
    reader: {
      type: "json",
      rootProperty: "data",
      totalProperty: "total"
    }
  },
  autoLoad: true
};
Enter fullscreen mode Exit fullscreen mode

The API must implement the corresponding request parameters and response format. Server-side authorization and filtering should always be enforced by the backend.

  1. Sorting and Filtering Users Can Control
    Enterprise users often need to sort by multiple columns and filter according to data type.
    Check support for text filters, numeric ranges, date filters, and selectable lists. Also verify that local and remote filtering behave consistently.

  2. Grouping and Summaries
    Grouping lets users organize records by fields such as region, department, or status. Summaries add subtotals and grand totals.
    ReExt can configure these features using the Ext JS store and grid features:

<ReExt
  xtype="grid"
  config={{
    store: {
      data: orders,
      groupField: "region"
    },
    features: [
      {
        ftype: "groupingsummary",
        groupHeaderTpl: "{name}"
      },
      {
        ftype: "summary",
        dock: "bottom"
      }
    ],
    columns: [
      {
        text: "Customer",
        dataIndex: "customer",
        flex: 1
      },
      {
        text: "Amount",
        dataIndex: "amount",
        xtype: "numbercolumn",
        summaryType: "sum"
      }
    ]
  }}
/>

Enter fullscreen mode Exit fullscreen mode

This is an illustrative configuration. The project also needs the appropriate ReExt setup and Ext JS resources.

  1. Inline Editing with Validation Editing directly in a grid is useful for order management, inventory, financial records, and other operational workflows. Evaluate cell and row editing, validation, dropdown editors, error handling, and how failed saves are rolled back. ReExt exposes Ext JS editing plugins and allows edit events to be handled by React:
<ReExt
  xtype="grid"
  config={{
    store: { data: orders },
    plugins: [
      {
        ptype: "cellediting",
        clicksToEdit: 1
      }
    ],
    columns: [
      {
        text: "Amount",
        dataIndex: "amount",
        editor: {
          xtype: "numberfield",
          minValue: 0,
          allowBlank: false
        }
      }
    ]
  }}
  onEdit={(editor, context) => {
    saveOrder(context.record.getData());
  }}
/>
Enter fullscreen mode Exit fullscreen mode

The application should validate changes on the server as well as in the UI.
6.** Locked Columns**
Locked columns keep important fields visible while users scroll horizontally.
Test how locking interacts with grouping, editing, keyboard navigation, and saved layouts.
ReExt uses Ext JS column configuration:

columns: [
  {
    text: "Order ID",
    dataIndex: "id",
    locked: true,
    width: 100
  },
  {
    text: "Customer",
    dataIndex: "customer",
    locked: true,
    width: 180
  },
  {
    text: "Amount",
    dataIndex: "amount",
    flex: 1
  }
]

Enter fullscreen mode Exit fullscreen mode

Enable column locking on the grid where required.

  1. Column Management and Saved Layouts
    Users may want to resize columns, change their order, hide irrelevant fields, and restore their preferred layout later.
    Evaluate whether layout persistence is built in or requires custom code. In Ext JS, stateful grids can use a state provider and a stable stateId to save column preferences.

  2. Range Selection and Clipboard
    Spreadsheet-style workflows can make data-heavy applications significantly easier to use.
    Check whether users can select ranges, copy cells to Excel, paste values, and navigate with the keyboard. These features may require a commercial tier depending on the grid.
    ReExt can use Ext JS's spreadsheet selection model and clipboard plugin, subject to the relevant version and licensing.

  3. Excel and CSV Export
    Export should preserve meaningful data, not just produce a file.
    Test numeric and date types, formatting, grouped rows, summaries, filters, and behavior with large datasets.
    ReExt provides the Ext JS grid exporter through a plugin. An illustrative React button can call the grid's export method:

import { useRef } from "react";
import ReExt from "@sencha/reext";

function ExportableGrid({ orders }) {
  const gridRef = useRef(null);

  return (
    <>
      <ReExt
        xtype="grid"
        ready={(grid) => {
          gridRef.current = grid;
        }}
        config={{
          store: { data: orders },
          plugins: [
            { ptype: "gridexporter" }
          ],
          columns: [
            {
              text: "Customer",
              dataIndex: "customer",
              flex: 1
            },
            {
              text: "Amount",
              dataIndex: "amount",
              xtype: "numbercolumn"
            }
          ]
        }}
      />

      <button
        onClick={() =>
          gridRef.current?.saveDocumentAs({
            type: "excel07",
            fileName: "orders.xlsx"
          })
        }
      >
        Export to Excel
      </button>
    </>
  );
}
Enter fullscreen mode Exit fullscreen mode

The exporter requires the appropriate Enterprise package and setup. If users need all records matching a server-side filter, a backend export endpoint may be more appropriate than exporting only loaded rows.

  1. Pivoting and Analytics Pivoting turns records into a multidimensional summary. Users might analyze revenue by region and quarter without manually creating a new report for each combination. With ReExt, the Ext JS pivot grid can be configured using dimensions and aggregations:
<ReExt
  xtype="pivotgrid"
  style={{ height: 400 }}
  config={{
    store: { data: sales },
    matrix: {
      leftAxis: [
        {
          dataIndex: "region",
          header: "Region"
        }
      ],
      topAxis: [
        {
          dataIndex: "quarter",
          header: "Quarter"
        }
      ],
      aggregate: [
        {
          dataIndex: "revenue",
          aggregator: "sum",
          header: "Revenue"
        }
      ]
    }
  }}
/>


Enter fullscreen mode Exit fullscreen mode

Pivoting is part of the Ext JS Enterprise offering. Confirm the appropriate package and version before implementing it.

  1. Tree Data and Master-Detail Not all enterprise data is flat. Account hierarchies, organizational structures, and bills of materials may need tree views. Orders may need expandable detail rows showing individual line items.

Test lazy loading, keyboard navigation, expandable rows, and the behavior of nested data.
ReExt provides access to Ext JS tree panels and grid row-expander functionality, which can be useful when an application needs several related views.

  1. Accessibility and Keyboard Navigation Accessibility should be part of grid evaluation from the beginning. Test cell navigation, editing, sorting, menus, focus behavior, and screen-reader announcements. Run an accessibility audit against your application's applicable requirements rather than relying only on a vendor's claims. ReExt makes Ext JS keyboard and ARIA capabilities available, but the completed application still needs to be tested. What Is ReExt, and When Should You Consider It? ReExt brings Ext JS components into React applications. It can be useful when the application needs a sophisticated grid along with forms, charts, trees, layouts, and other business UI components. The Ext JS grid provides a broad set of data manipulation capabilities. Pivoting and the exporter require the Enterprise plan, while other feature availability depends on the

Conclusion

Choosing an enterprise React data grid requires looking beyond sorting and filtering. Performance, server-side data, editing, grouping, locking, layout persistence, clipboard, export, pivoting, hierarchical data, and accessibility can all influence the final decision.
ReExt is one option for bringing Ext JS grid capabilities into React, especially when the rest of the enterprise component ecosystem is relevant to the application.
Read the complete guide: How to Choose a React Grid Component: 12 Features Enterprise Apps Need

Top comments (0)