Skip to content

Angular-Slickgrid is a wrapper of the lightning fast & customizable SlickGrid datagrid, it also includes multiple Styling Themes

License

Notifications You must be signed in to change notification settings

zewa666/Angular-Slickgrid

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Angular-Slickgrid

License: MIT TypeScript NPM downloads npm

Actions Status Cypress.io jest codecov

Brief introduction

One of the best JavasSript datagrid SlickGrid, which was originally developed by @mleibman, is now available to Angular. SlickGrid beats most other datagrids in terms of features, customizability and performance (it can easily deal with even a million row). Angular-Slickgrid is a wrapper on top of SlickGrid and it requires Slickgrid-Universal dependency, originally we used the 6pac/SlickGrid fork but that was dropped in >=7.0, so we no longer need external SlickGrid dependencies anymore apart from Slickgrid-Universal since v7.0. SlickGrid was also recently refactored to be browser native (no more jQuery).

License

MIT License

Documentation

πŸ“• Documentation website powered by GitBook.

Installation

A good starting point is the Docs - Quick Start and/or simply clone the Angular-Slickgrid Demos repository. Please review all documentation and closed issues before opening any new issue, also consider asking installation and/or general questions on Stack Overflow unless you think there's a bug with the library.

npm install angular-slickgrid

Demo page

Angular-Slickgrid works with all Bootstrap versions, you can see a demo of each one below. It also with any other framework like Material or Bulma and there are also extra styling themes for not just Bootstrap but also Material & Salesforce which are also available. You can also use different SVG icons, you may want to look at the Docs - SVG Icons

Bootstrap 5 with single Locale - Code Sample with single Locale (without ngx-translate)

Working Demo

For a complete set of working demos (over 30 examples), we strongly suggest you to clone the Angular-Slickgrid Demos repository (instructions are provided in the demo repo). The repo provides multiple demos and they are updated every time a new version is released, so it is updated frequently and is also used as the GitHub live demo page for both the Bootstrap 5 demo and Bootstrap 4 demo.

git clone https://github.com/ghiscoding/angular-slickgrid-demos
cd bootstrap4-demo-with-translate # or any of the 4 demos
npm install
npm start

Like it? ⭐ it

You like to use Angular-Slickgrid? Be sure to upvote ⭐ and maybe support me with caffeine β˜• and feel free to contribute. πŸ‘·πŸ‘·β€β™€οΈ

Buy Me a Coffee at ko-fi.com

Contributions

If you wish to contribute then make sure to follow the steps shown in the CONTRIBUTING guide.

Latest News & Releases

Check out the Releases section for all latest News & Releases.

Troubleshooting / Documentation

The Documentation is powered by GitBook and is where you'll find all the documentation, so please consult the Angular-Slickgrid - Documentation before opening any issues. The Docs - Quick Start is a great place to start with. You can also take a look at the Demo page, it includes sample for most of the features and it keeps growing (so you might want to consult it whenever a new version comes out).

For common issues, see the Troubleshooting Section below

Angular Compatibility

Note please be aware that only the latest version of Angular-Slickgrid is supported and will receive bug fixes. The reason older versions are not supported is simply because it's already a lot of work to maintain for a single developer.

Angular-Slickgrid Angular version Migration Guide Notes
7.x >=17.0 Migration 7.x merge SlickGrid into Slickgrid-Universal, requires Slickgrid-Universal 4.x version
6.x >=16.0 Migration 6.x removal of jQuery (now uses browser native code), requires Slickgrid-Universal 3.x version
5.x >=14.0 Migration 5.x removal of jQueryUI, requires Slickgrid-Universal 2.x version
4.x >=13.0 Migration 4.x for Ivy build only, requires Slickgrid-Universal 1.x version
3.x >=12.0 Migration 3.x the lib now uses Slickgrid-Universal monorepo v0.19.2. Also, IE11 is EOL and no longer supported.
2.x 7-11.x Migration 2.x support multiple grids on same page
1.x 4-6.x

Note For a full compatibility table of Angular-Slickgrid with Slickgrid-Universal, please take a look at the Versions Compatibility Table - Wiki.

For Angular 12+ see the instructions below - Angular 12 with WebPack 5 - polyfill issue.

ngx-translate Compatibility

Angular-Slickgrid uses ngx-translate library to support Locales, it is also required even when using a single Locale. The reason is because, we use @Optional() TranslateService in the lib and for that to work, it requires ngx-translate to installed. Once you run the build and if you are using a single Locale then the tree shaking process should remove these optional dependencies. See their version compatibility table below for more info

Angular Version @ngx-translate/core
16+ 15.x
13+ (Ivy only) 14.x
10-13 13.x
8-9 12.x
7 11.x

Fully Tested with Jest (Unit Tests) - Cypress (E2E Tests)

Angular-Slickgrid and Slickgrid-Universal both have 100% Unit Test Coverage, that includes over +4,000 unit tests using Jest. On the UI side, all Angular-Slickgrid Examples are tested with Cypress, there are over +500 Cypress E2E tests.

How to load data with HttpClient?

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

Main features

You can see some screenshots below and visit the Documentation website.

Troubleshooting Section

Angular 12 with WebPack 5 - how to fix polyfill error

Since Angular 12 switched to WebPack 5, you might get some new errors and you will need to add some polyfills manually to get the Excel Builder (Excel Export) to work.

The error you might get

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

Steps to fix it

  1. npm install stream-browserify
  2. Add a path mapping in tsconfig.json:
{
  ...
  "compilerOptions": {
    "paths": {
      "stream": [ "./node_modules/stream-browserify" ]
    },
  1. Add stream to allowedCommonJsDependencies in angular.json:
  "options": {
    "allowedCommonJsDependencies": [
      "excel-builder-webpacker",
      "stream"
    ],

ngcc Build Warnings (Angular >=8.0 && <16.0)

You might get warnings about SlickGrid while doing a production build, most of them are fine and the best way to fix them, is to simply remove/ignore the warnings to CommonJS packages, all you have to do is to add a file named ngcc.config.js in your project root (same location as the angular.json file) with the following content (you can also see this commit which fixes the Angular-Slickgrid-Demos prod build):

module.exports = {
  packages: {
    'angular-slickgrid': {
      ignorableDeepImportMatchers: [
        /assign-deep/,
        /slickgrid\//,
        /flatpickr/,
        /dequal/,
      ]
    },
  }
};

You should also add Angular-Slickgrid as an allowed CommonJS dependency to your angular.json file to silence the warnings.

"options": {
  "allowedCommonJsDependencies": ["angular-slickgrid"]
}

strictTemplates error

In Angular 14 and higher, Angular has a strictTemplates flag in your tsconfig.json file (enabled by default when creating new projects from CLI) which causes issues with Angular-Slickgrid events with errors similar to this:

Property 'detail' does not exist on type 'Event'. (onAngularGridCreated)="angularGridReady($event.detail)"

The reason is because Angular-Slickgrid uses Custom Event for all its events and Angular complains because these Custom Events aren't typed. In order to fix this issue, you have 3 viable approaches:

  1. disabled strictTemplates in your tsconfig.json config
  2. cast the event in the View template to $any type
    • $any($event) for example $any($event).detail.eventData
  3. cast the event in the component ViewModel to CustomEvent
<angular-slickgrid gridId="grid28"
    [columnDefinitions]="columnDefinitions"
    [gridOptions]="gridOptions"
    [dataset]="dataset"
    (onAngularGridCreated)="angularGridReady($event.detail)">
</angular-slickgrid>
angularGridReady(event: CustomEvent) {
  this.angularGrid = event.detail as AngularGridInstance;
  this.gridObj = this.angularGrid.slickGrid;
}

The simplest is obviously the option 1 but you lose the strictness on the view templates, more details can found under the discussion (strictTemplates) Template error , I have also opened a similar Stack Overflow question myself: How to use Custom Event (not Event Emitter) without strictTemplates to complain about $event not being a Custom Event type?.

Screenshots

Screenshots from the demo app with the Bootstrap theme.

Note that the styling changed a bit, the best is to simply head over to the Live Demo page.

Slickgrid example with Formatters (last column shown is a custom Formatter)

You can also see the Grid Menu opened (aka hambuger menu)

Default Slickgrid Example

Filters and Multi-Column Sort

Filter and Sort

Inline Editing

Editors

Pinned (aka frozen) Columns/Rows

Pinned Columns/Rows

Draggable Grouping & Aggregators

Draggable Grouping

Slickgrid Example with Server Side (Filter/Sort/Pagination)

Comes with OData & GraphQL support (you can implement custom ones too)

Slickgrid Server Side

Composite Editor Modal Windows

Composite Editor Modal

About

Angular-Slickgrid is a wrapper of the lightning fast & customizable SlickGrid datagrid, it also includes multiple Styling Themes

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 92.1%
  • HTML 6.9%
  • SCSS 1.0%