Convert Figma logo to code with AI

6pac logoSlickGrid

A lightning fast JavaScript grid/spreadsheet

1,818
423
1,818
15

Top Related Projects

A lightning fast JavaScript grid/spreadsheet

12,496

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

JavaScript data grid with a spreadsheet look & feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡

25,067

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table

Build interactive dashboards in minutes.

Quick Overview

SlickGrid is a powerful, customizable JavaScript grid/spreadsheet component. It's designed for handling large datasets with high performance, offering features like virtual rendering and frozen columns. SlickGrid is particularly useful for applications requiring advanced data manipulation and display capabilities.

Pros

  • Excellent performance with large datasets (100,000+ rows)
  • Highly customizable with numerous plugins and extensions
  • Supports virtual rendering for efficient memory usage
  • Provides advanced features like frozen columns and rows

Cons

  • Steep learning curve due to its complexity
  • Documentation can be outdated or incomplete in some areas
  • Requires more setup and configuration compared to simpler grid libraries
  • Limited built-in responsive design support

Code Examples

  1. Basic grid initialization:
const grid = new Slick.Grid("#myGrid", data, columns, options);
  1. Adding a custom formatter:
const columns = [
  {
    id: "title",
    name: "Title",
    field: "title",
    formatter: (row, cell, value, columnDef, dataContext) => {
      return `<b>${value}</b>`;
    }
  }
];
  1. Implementing row selection:
const options = {
  enableCellNavigation: true,
  enableColumnReorder: false,
  multiSelect: false
};

grid.setSelectionModel(new Slick.RowSelectionModel(options));

grid.onSelectedRowsChanged.subscribe((e, args) => {
  const selectedRows = args.rows;
  console.log("Selected rows:", selectedRows);
});

Getting Started

  1. Include SlickGrid files in your HTML:
<link rel="stylesheet" href="slick.grid.css" type="text/css"/>
<script src="jquery-3.6.0.min.js"></script>
<script src="jquery.event.drag-2.3.0.js"></script>
<script src="slick.core.js"></script>
<script src="slick.grid.js"></script>
  1. Create a container for the grid:
<div id="myGrid" style="width:600px;height:500px;"></div>
  1. Initialize the grid with data, columns, and options:
const data = [/* your data array */];
const columns = [/* your column definitions */];
const options = {
  enableCellNavigation: true,
  enableColumnReorder: false
};

const grid = new Slick.Grid("#myGrid", data, columns, options);

Competitor Comparisons

A lightning fast JavaScript grid/spreadsheet

Pros of SlickGrid (mleibman)

  • Original implementation with a longer history
  • More established community and documentation
  • Potentially more stable codebase due to its maturity

Cons of SlickGrid (mleibman)

  • Less actively maintained compared to the 6pac fork
  • May lack some modern features and optimizations
  • Potentially outdated dependencies and compatibility issues

Code Comparison

SlickGrid (mleibman):

grid = new Slick.Grid("#myGrid", data, columns, options);
grid.setSelectionModel(new Slick.CellSelectionModel());
grid.registerPlugin(new Slick.AutoTooltips());

SlickGrid (6pac):

grid = new Slick.Grid("#myGrid", data, columns, options);
grid.setSelectionModel(new Slick.CellSelectionModel());
grid.registerPlugin(new Slick.AutoTooltips({ enableForCells: true }));

The code structure is similar between the two repositories, with minor differences in plugin options and available features. The 6pac fork may offer more flexibility and additional options for certain plugins.

Both repositories provide a powerful and flexible grid component for web applications. While the mleibman version is the original implementation, the 6pac fork has become more actively maintained and may offer more up-to-date features and compatibility. Users should consider their specific requirements and the level of ongoing support when choosing between the two options.

12,496

The best JavaScript Data Table for building Enterprise Applications. Supports React / Angular / Vue / Plain JavaScript.

Pros of ag-Grid

  • More comprehensive feature set, including built-in filtering, sorting, and grouping
  • Better documentation and community support
  • Regular updates and active development

Cons of ag-Grid

  • Steeper learning curve due to more complex API
  • Larger file size and potentially higher performance overhead
  • Commercial license required for some advanced features

Code Comparison

SlickGrid basic grid initialization:

var grid = new Slick.Grid("#myGrid", data, columns, options);

ag-Grid basic grid initialization:

var gridOptions = { columnDefs: columnDefs, rowData: rowData };
new agGrid.Grid(gridDiv, gridOptions);

Both libraries offer powerful grid functionality, but ag-Grid provides a more feature-rich experience out of the box. SlickGrid is lighter weight and may be easier to customize for specific use cases. ag-Grid has a larger community and more frequent updates, while SlickGrid has a simpler API that might be easier for beginners to grasp. The choice between the two depends on project requirements, desired features, and development team preferences.

JavaScript data grid with a spreadsheet look & feel. Works with React, Angular, and Vue. Supported by the Handsontable team ⚡

Pros of Handsontable

  • More feature-rich out of the box, including advanced cell types and data validation
  • Better documentation and examples for easier implementation
  • Active development with frequent updates and community support

Cons of Handsontable

  • Larger file size and potentially slower performance for very large datasets
  • Commercial license required for some features and use cases
  • Steeper learning curve due to more complex API

Code Comparison

Handsontable:

const hot = new Handsontable(container, {
  data: dataset,
  columns: [
    { type: 'text' },
    { type: 'numeric', format: '0.00' },
    { type: 'date', dateFormat: 'MM/DD/YYYY' }
  ],
  rowHeaders: true,
  colHeaders: true
});

SlickGrid:

const grid = new Slick.Grid("#myGrid", data, columns, options);
grid.setSelectionModel(new Slick.CellSelectionModel());
grid.registerPlugin(new Slick.CellExternalCopyManager());

Both libraries offer powerful grid functionality, but Handsontable provides more built-in features and a higher-level API, while SlickGrid offers more flexibility and potentially better performance for large datasets. The choice between them depends on specific project requirements and performance needs.

25,067

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table

Pros of TanStack Table

  • More modern and flexible architecture, supporting React, Vue, and Solid
  • Better TypeScript support and type safety
  • Lightweight and modular design, allowing for easier customization

Cons of TanStack Table

  • Less out-of-the-box features compared to SlickGrid
  • Steeper learning curve for complex implementations
  • May require more setup and configuration for advanced use cases

Code Comparison

SlickGrid:

var grid = new Slick.Grid("#myGrid", data, columns, options);
grid.onCellChange.subscribe(function (e, args) {
  console.log("Cell changed: ", args);
});

TanStack Table:

const table = useReactTable({
  data,
  columns,
  getCoreRowModel: getCoreRowModel(),
});
return <TableComponent table={table} />;

The code comparison shows that SlickGrid uses a more traditional object-oriented approach, while TanStack Table leverages modern React hooks and components. SlickGrid provides built-in event handling, whereas TanStack Table relies on React's state management and prop passing for similar functionality.

Build interactive dashboards in minutes.

Pros of Gridstack.js

  • Drag-and-drop functionality for grid items
  • Responsive design with mobile support
  • Easier to implement for dashboard-like layouts

Cons of Gridstack.js

  • Less suitable for large datasets and high-performance requirements
  • Limited built-in features for data manipulation and advanced grid operations

Code Comparison

SlickGrid:

var grid = new Slick.Grid("#myGrid", data, columns, options);
grid.onCellChange.subscribe(function (e, args) {
    // Handle cell change
});

Gridstack.js:

var grid = GridStack.init();
grid.addWidget('<div><div class="grid-stack-item-content">Item</div></div>', 
    {width: 2, height: 2, x: 0, y: 0});

Key Differences

  • SlickGrid is optimized for handling large datasets and complex grid operations
  • Gridstack.js focuses on creating dynamic, draggable grid layouts
  • SlickGrid offers more advanced data manipulation features
  • Gridstack.js provides an easier setup for responsive, dashboard-style interfaces

Use Cases

  • Choose SlickGrid for applications requiring high-performance data grids with extensive customization
  • Opt for Gridstack.js when building responsive dashboards or layouts with draggable elements

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

License: MIT TypeScript NPM downloads jsdelivr hits/month

Cypress.io npm Actions Status

This is the 6pac SlickGrid repo

Check out the NEW SlickGrid Website! http://slickgrid.net/

This is the acknowledged and most active fork of SlickGrid.

It aims to be a viable alternative master repo, building on the legacy of the mleibman/SlickGrid master branch, keeping dependencies up to date and applying, safe core patches and enhancements to keep the project up to date.

We extended the project from the original SlickGrid foundation while also including the following changes:

  • added a few more Plugins: RowDetail, CellMenu, ContextMenu, GridMenu, CustomTooltip, GridState
  • merged X-SlickGrid code into the project to bring Frozen Columns/Rows (aka Pinning)
  • removed jQueryUI requirement in v3 (replaced it with SortableJS)
  • removed jQuery requirement in v4
  • modernized the project in v5 by migrating to TypeScript (we kept IIFE and added ES6/ESM build targets) and we also gave SlickGrid a fresh and more modern look via a new Alpine Theme (CSS/SASS)
  • the project now has only 1 required dependency which is SortableJS

Examples

Check out the Examples Wiki for a full list of examples demonstrating new features and use cases, such as dynamic grid creation and editors with third party controls.

Also take a look at the Wiki and Releases for documentation and news.

For a basic TypeScript example, take a look at the v5.0 Annoucement & Migration guide shown below and also the TypeScript Example Wiki.

Installation

There are multiple ways to use and install SlickGrid, you can use it as a standalone (IIFE) or install it through NPM then import or require SlickGrid (import is preferred for tree shaking).

# Alpine style from CDN
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/slickgrid@5.12.1/dist/styles/css/slick-alpine-theme.min.css">

# standalone scripts (IIFE) from CDN
<script src="https://cdn.jsdelivr.net/npm/slickgrid@5.12.1/dist/browser/slick.core.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/slickgrid@5.12.1/dist/browser/slick.interactions.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/slickgrid@5.12.1/dist/browser/slick.grid.min.js"></script>
<script>
  const grid = new Slick.Grid("#myGrid", dataView, columns, options);
</script>
---
# or install from NPM
npm install slickgrid

<script type="module">
  import 'slickgrid/dist/styles/css/slick-alpine-theme.css';
  import { SlickGrid, SlickDataView } from 'slickgrid';
  const dataView = new SlickDataView({ inlineFilters: true });
  const grid = new SlickGrid("#myGrid", dataView, columns, options);
</script>

For more CDN links, like controls and plugins, just headover to jsDevlivr - SlickGrid for the full list and click on the "Files" tab (or use this jsdelivr CDN link "dist/browser").

Contributions

See Contributing Guide

E2E Tests with Cypress

We have started to add E2E (end to end) tests in the browser by using Cypress. You can see here the list of Examples that now have E2E tests. We also run these tests in the GitHub Actions Workflow (CI) on every Pull Request to avoid committing changes that might break the library. We currently have tests for over 30+ examples with over 350+ tests.

We welcome any new contributions and if you wish to add Cypress E2E tests, all you need to do is to clone the repo and run the following commands

npm install         # install all npm packages
npm run dev         # run a local development server on port 8080 in watch mode (or `npm run serve` without watch)
npm run cypress     # open Cypress UI tool

Once the Cypress UI is open, you can then click on "Run all Specs" to execute all E2E browser tests.

Migrations

SlickGridMigration GuideDescription
3.xAnnouncing v3.0dropping jQueryUI requirement and replaced it with SortableJS which is a lot more modern and touch friendly
4.xAnnouncing v4.0dropping jQuery requirement, SlickGrid is now using browser native code
5.xAnnouncing v5.0project modernization, we added TypeScript with ES6, ESM builds and also a new Alpine Theme

CSP Compliance

The library is now, at least for the most part, CSP (Content Security Policy) compliant since v5.5.0, however there are some exceptions to be aware of. When using any html string as template (for example with Custom Formatter returning an html string), you will not be fully compliant unless you return TrustedHTML. You can achieve this by using the sanitizer method in combo with DOMPurify to return TrustedHTML, for more info please take a look at the CSP Compliance Wiki.

Quick Little Fun Survey ✨

We are conducting a small little poll for fun, it is a single question survey about our latest releases. Thanks for taking the time to participate.

What do you think was the most exciting change(s) for you?

NPM DownloadsLast 30 Days