📙
Aurelia-Slickgrid
Live DemoGitHub
  • Introduction
  • Getting Started
    • Quick start
  • Styling
    • Dark Mode
    • Styling CSS/SASS/Themes
  • Column Functionalities
    • Cell Menu (Action Menu)
    • Editors
      • Autocomplete
      • old Date Picker (flatpickr)
      • new Date Picker (vanilla-calendar)
      • LongText (textarea)
      • Select Dropdown Editor (single/multiple)
    • Filters
      • Autocomplete
      • Input Filter (default)
      • Select Filter (dropdown)
      • Compound Filters
      • Range Filters
      • Custom Filter
      • Styling Filled Filters
      • Single Search Filter
    • Formatters
    • Sorting
  • Events
    • Available events
    • On Events
  • Slick Grid/DataView Objects
    • Slick Grid/DataView Objects
  • Grid Functionalities
    • Auto-Resize / Resizer Service
    • Resize by Cell Content
    • Column Picker
    • Composite Editor Modal
    • Custom Tooltip
    • Add, Update or Highlight a Datagrid Item
    • Dynamically Add CSS Classes to Item Rows
    • Column & Row Spanning
    • Context Menu
    • Custom Footer
    • Excel Copy Buffer Plugin
    • Export to Excel
    • Export to File (csv/txt)
    • Grid Menu
    • Grid State & Presets
    • Grouping & Aggregators
    • Header & Footer Slots
    • Header Menu & Header Buttons
    • Infinite Scroll
    • Pinning (frozen) of Columns/Rows
    • Providing data to the grid
    • Row Detail
    • Row Selection
    • Tree Data Grid
    • Row Based Editing Plugin
  • Developer Guides
    • CSP Compliance
  • Localization
    • with I18N
    • with Custom Locales
  • Backend Services
    • Custom Backend Service
    • OData
    • GraphQL
      • JSON Result Structure
      • Filtering Schema
      • Pagination Schema
      • Sorting Schema
  • Testing
    • Testing Patterns
  • Migrations
    • Migration Guide to 2.x (2018-06-23)
    • Migration Guide to 3.x (2020-12-20)
    • Migration Guide to 4.x (2021-12-11)
    • Migration Guide to 5.x (2022-10-18)
    • Migration Guide to 6.x (2023-05-29)
    • Migration Guide to 7.x (2023-12-15)
    • Migration Guide to 8.x (2024-05-10)
    • Migration Guide to 9.x (2025-05-10)
Powered by GitBook
On this page
  • Easiest Way to Get Started
  • 1. Install NPM Package
  • 2. CSS / SASS Styles
  • 3. Include it in your App
  • 4. Install/Setup I18N for Localization (optional)
  • 5. Create a basic grid
  • 6. Client samples
  • 7. Explore the Documentation page content
  • 8. How to load data with Fetch-Client or Http-Client?
  • 9. Get Started
  • 10. CSP Compliance
  • 11. Add Optional Feature like Excel Export
  • 12. Missing Features? (fear not)
  • 13. Having some issues?
  • Final word
Edit on GitHub
  1. Getting Started

Quick start

Last updated 1 month ago

NOTE The Documentations shown on this website are meant for Aurelia-Slickgrid v7.x and higher, for older versions please refer to the project for earlier versions of the project.

Easiest Way to Get Started

The easiest is to simply clone the project and run it from there... or if you really wish to start from scratch then follow the steps below.

1. Install NPM Package

Install the Aurelia-Slickgrid and optionally Bootstrap

npm install --save aurelia-slickgrid bootstrap # Bootstrap is optional

Note: Bootstrap is optional, you can use any other lib that you want

2. CSS / SASS Styles

Load the default Bootstrap theme style or scroll down for SASS customization.

CSS

Default compiled css (if you use the plain Bootstrap Theme CSS, you could simply add it to your index.html file and be done with it).

WebPack

// Bootstrap is optional, you can use any framework
import 'bootstrap/dist/css/bootstrap.css';
import 'multiple-select-modified/src/multiple-select.css';

// if you use CSS instead of SASS
import '@slickgrid-universal/common/dist/styles/css/slickgrid-theme-default.css';
// or other available themes
import '@slickgrid-universal/common/dist/styles/css/slickgrid-theme-bootstrap.css';
import '@slickgrid-universal/common/dist/styles/css/slickgrid-theme-material.css';
import '@slickgrid-universal/common/dist/styles/css/slickgrid-theme-salesforce.css';

SASS (scss)

@use '../node_modules/@slickgrid-universal/common/dist/styles/sass/slickgrid-theme-default.scss' with (
  $cell-odd-background-color: lightyellow,
  $row-mouse-hover-color: lightgreen
);

3. Include it in your App

Aurelia main.ts

Make the plugin available globally in your main.js file.

WebPack (add the PLATFORM.moduleName)

export function configure(aurelia) {
  aurelia.use.plugin(PLATFORM.moduleName('aurelia-slickgrid'));
  aurelia.start().then(() => aurelia.setRoot());
}

4. Install/Setup I18N for Localization (optional)

To provide locales other than English (default locale), you have 2 options that you can go with. If you only use English, there is nothing to do (you can still change some of the texts in the grid via option 1.)

5. Create a basic grid

View

<aurelia-slickgrid
    grid-id="grid1"
    columns.bind="columnDefinitions"
    options.bind="gridOptions"
    dataset.bind="dataset">
</aurelia-slickgrid>

ViewModel

export class Example1 {
  gridOptions;
  columnDefinitions;
  dataset = [];

  constructor() {
    // define the grid options & columns and then create the grid itself
    this.defineGrid();
  }

  attached() {
    // populate the dataset once the grid is ready
    this.getData();
  }

  /* Define grid Options and Columns */
  defineGrid() {
    this.columnDefinitions = [
      { id: 'title', name: 'Title', field: 'title', sortable: true, minWidth: 100 },
      { id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true, minWidth: 100 },
      { id: '%', name: '% Complete', field: 'percentComplete', sortable: true, minWidth: 100 },
      { id: 'start', name: 'Start', field: 'start', minWidth: 100 },
      { id: 'finish', name: 'Finish', field: 'finish', minWidth: 100 },
      { id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', sortable: true, minWidth: 100 }
    ];
    this.gridOptions = {
      enableAutoResize: false,
      gridHeight: 600,
      gridWidth: 800,
    };
  }

  getData() {
    // mock a dataset
    this.dataset = [];
    for (let i = 0; i < 1000; i++) {
      const randomYear = 2000 + Math.floor(Math.random() * 10);
      const randomMonth = Math.floor(Math.random() * 11);
      const randomDay = Math.floor((Math.random() * 29));
      const randomPercent = Math.round(Math.random() * 100);

      this.dataset[i] = {
        id: i,
        title: 'Task ' + i,
        duration: Math.round(Math.random() * 100) + '',
        percentComplete: randomPercent,
        start: `${randomMonth}/${randomDay}/${randomYear}`,
        finish: `${randomMonth}/${randomDay}/${randomYear}`,
        effortDriven: (i % 5 === 0)
      };
    }
  }
}

6. Client samples

7. Explore the Documentation page content

The last step is really to explore all the pages that are available in the documentation, everything you need to use the library should be available in here and so you should visit it often. For example a good starter is to look at the following

  • ... and much more, just explorer all the Documentations available

    • it gets updated very frequently, we usually mention any new/updated documentation in any new version release

8. How to load data with Fetch-Client or Http-Client?

9. Get Started

All Live Demo Examples have links to the actual code

Like to see the code to a particular Example? Just click on the "see code" that is available in every live examples.

10. CSP Compliance

11. Add Optional Feature like Excel Export

Starting with version 3.0.0, the Excel Export is now an optional package and if you want to use it then you'll need to install it via npm from the monorepo library with npm install @slickgrid-universal/excel-export. Refer to the "Excel Export" from the documentations for more info.

Here's a quick list of some of these optional packages

12. Missing Features? (fear not)

What if Aurelia-Slickgrid is missing feature(s) versus the original SlickGrid? Fear not and directly use the SlickGrid and DataView objects that are expose from the start through Event Emitters. For more info continue reading on "SlickGrid & DataView objects" and "Grid & DataView Events"

13. Having some issues?

Final word

You could also compile the SASS files with your own customization, for that simply take any of the (without the !default flag) variable from the file and make sure to import the Bootstrap Theme afterward. For example, you could modify your style.scss with the following changes:

If you don't want to use any Translate Service and use only 1 Locale then take a look at this

Using , that is when you use only 1 locale (other than English)... this is a new feature starting from version 2.10.0 and up.

Using , that is when you want to use multiple locales dynamically.

There are multiple demos (WebPack, RequireJS, CLI, ...) that you can clone and refer to (2 of them are actually used to update the GitHub demo pages and are updated frequently). So to get you started, you can clone the repo.

for all the Grid Options, take a look at all the interface.

You might notice that all demos are made with mocked dataset that are embedded in each examples, that is mainly for demo purposes, but you might be wondering how to connect this with an FetchClient? Easy... just replace the mocked data, assigned to the dataset property, by your FetchClient call and that's it. The dataset property can be changed at any time, which is why you can use local data and/or connect it to a Promise or an async call with FetchClient (internally it's just a SETTER that refreshes the grid). See for a demo showing how to load a JSON file with FetchClient.

The best way to get started is to clone the , it has multiple examples and it is also updated frequently since it is used for the GitHub Bootstrap 5 demo page. Aurelia-Slickgrid has 2 Bootstrap themes, you can see a demo of each one below.

/ (with I18N Service)

(without I18N Service)

The project supports Content Security Policy (CSP) as long as you provide an optional sanitizer in your grid options (we recommend DOMPurify). Review the documentation for more info.

After reading all this HOW TO, what if you have an issue with the grid? Please start by searching any related . If you can't find anything in the issues log and you made sure to also look through the multiple documentation pages as well, then go ahead and fill in a and we'll try to help.

This project is Open Source and is, for the most part, mainly done in spare time. So please be respectful when creating issues (and fill in the issue template) and I will try to help you out. If you like my work, you can also ☕️, some part of the code happens when I'm at StarBucks... That is it, thank you and don't forget to ⭐ it if you like the lib 😉

Wikis
Aurelia-Slickgrid-Demos
_variables.scss
demo
Custom Locale
Localization with I18N
aurelia-slickgrid-demos
Grid Options
Formatters
Editors
Filters
Grid Menu
Example 22
Aurelia-Slickgrid-demos
Bootstrap 5 demo
examples repo
Bootstrap 5 - examples repo
CSP Compliance
@slickgrid-universal/excel-export
@slickgrid-universal/text-export
@slickgrid-universal/graphql
@slickgrid-universal/odata
issues
new issue
buy me a coffee