Angular SlickGrid: Key Differences Between Versions 1.5 and 2

...and how to make SlickGrid working for different browsers?

Table of content

Diatom Enterprises possesses several years of expertise in Angular. On one of Diatom’s recent projects, we had to explore how different versions of Angular work with grids. The task was to adapt a JavaScript data table component called SlickGrid for Angular 1.5 and Angular 2.0. SlickGrid is built for fast rendering of large data sets, such as the 10,000 records in our case. Our Angular Development & R&D departments gave me the task of exploring this issue, and now I would like to share our experience configuring SlickGrid for different versions of Angular, as well as how to make it work with different browsers (Chrome is the default).

Part 1 – Configure SlickGrid

For simplicity’s sake, I will use the shorthand “Grid”, for the SlickGrid JavaScript data table component.

The JavaScript module of the Grid works almost the same way in Angular 1.5 and Angular 2/4 (same internal API and logic). You need to prepare the Angular 1 and 2/4 frameworks differently in order to include the Grid.

The Grid for Angular 2.0 looks like this:

Part 1 – Configure SlickGrid

Using components makes it possible to use the Grid without any difficult configuration. For Angular 2.0, you just embed the <slick-grid> (for 1.5, I defined <slick-Grid-List>) element in any of your templates and pass a collection of data elements as an attribute. For Angular 1.5, I use list=’<array of objects>’, for Angular 2, [dataRows]=’collection of IGridDataRow’.

Note:
The component written in Angular 1.x is called “Slick-Grid-List.”
For Angular 2.x, you should use the “slick-grid” component provided by Microsoft in its angular2-slickgrid project, which you install with npm.

Also, it is possible to configure Column Definitions for the Grid. For Angular 2.0, just pass [columnDefinitions]=<array of IColumnDefinition>. For the 1.5 version, it is configured through the component file.

And lastly, editing the Grid is also possible. To enable it, use the “options” object for initializing the js-part of the Grid: set “editable: true.”

Then subscribe to the edit event.

In Angular 1.5:
Attribute on <slick-Grid-List> – on-update=update(item)  – “update” must be a method in your scope.

In Angular 2/4:
You need to subscribe in the code to the “cellEditExit” event of SlickGrid javascript component.

This is an example of subscribing:

this.slickGrid.cellEditExit.subscribe(function (e) {
            let editedPerson: IPerson = _self.persons[e.row];
            (editedPerson as any)[_self.fieldsArray[e.column]] = e.newValue;

            console.log("New edited person: " + editedPerson);
            console.log(e.newValue + " of id: " + _self.persons[e.row].Id);

        });
-	_self – is just reference for “this” upper level. 
-	_self.persons – is collection of data items which have object-style-definition.\
-	E.row, e.column, e.newValue = number of row and column, and new value of cell.

To display data in the Angular 2.0 grid, you should use an IGridDataRow array; each element has a “value” property and it should be an array (of strings or any other type). You might need to convert your objects-style data items to an array (with arrays in each value).

It is also necessary to set an Id attribute for the SlickGrid element in the template (<Slick-grid #slickgrid …>).

Part 2 – Make it work with different browsers

Tweak the js “Slick.Grid.js” component to make records display correctly in Firefox, Edge and IE.

We need to update the custom CSS-logic rules to correctly position the cells (columns) in Grid.

Edit the following file:

Slick.Grid.js
We need to change the way that SlickGrid appends new CSS-rules in the current document stylesheet. We change this by accessing the current document.styleSheets and doing stylesheetCreated.insertRule(rules[i],0) for every rule of the current stylesheet.

function createCssRules() {
      $style = $("<style type='text/css' rel='stylesheet' />").appendTo($("head"));
	  //get hack ssheet
	  var sheets = document.styleSheets;
	  var stylesheetCreated;
        for (i = 0; i < sheets.length; i++) {
          if ((sheets[i].ownerNode || sheets[i].owningElement) == $style[0]) {
            stylesheetCreated = sheets[i]; //this is important
            break;
          }
        }

        if (!stylesheetCreated) {
          throw new Error("Cannot find stylesheet.");
        }

      var rowHeight = (options.rowHeight - cellHeightDiff);
      var styles = {};
      styles["." + uid + " .slick-header-column"] = "{ left: 1000px; }",
      styles["." + uid + " .slick-top-panel"] = "{ height:" + options.topPanelHeight + "px; }",
      styles["." + uid + " .slick-headerrow-columns"] = "{ height:" + options.headerRowHeight + "px; }",
      styles["." + uid + " .slick-cell"] = "{ height:" + rowHeight + "px; }",
      styles["." + uid + " .slick-row"] = "{ height:" + options.rowHeight + "px; }"

      for (var i = 0; i < columns.length; i++) {
        styles["." + uid + " .l" + i] = " { }";
        styles["." + uid + " .r" + i] = " { }";
      }

      // make style rules apply to both light and shadow DOM
      var rules = [];
      for (var selector in styles) {
        //rules.push(selector + ", " + "::shadow " + selector + " " + styles[selector]); ////this is important – strange behavior in Mozilla
		rules.push(selector + " " + styles[selector]);
      }

      if ($style[0].styleSheet) { // IE
        $style[0].styleSheet.cssText = rules.join(" ");
      } else {
        //$style[0].appendChild(document.createTextNode(rules.join(" "))); //NOT Wokring in Mozilla&IE
		for (var i = 0; i < rules.length; i++) {
			
			stylesheetCreated.insertRule(rules[i],0); //this is important – new way of setting cssRules
		//$style[0].styleSheet.insertRule(rules[i],0);
		}
		
      }
    }

This file may be situated at Angular2GridApplication\node_modules\slickgrid\slick.grid.js

Conclusion of the Angular SlickGrid usage

I hope this article gave you an overview of how the JavaScript component of SlickGrid can be used in Angular 1.5 and Angular 2. For Angular 2.0, the Microsoft package has already adapted it as a component. While SlickGrid works in Chrome by default, minor adjustments were needed to display grids correctly in Firefox and Internet Explorer.

Update (October 2026): AngularJS (Angular 1.x) support ended on 31 December 2021, and Microsoft’s angular2-slickgrid repository is archived. The original SlickGrid has not been developed since 2014; the maintained fork is 6pac/SlickGrid (the slickgrid package on npm). For current Angular projects, Ghislain B. (ghiscoding) maintains Angular-Slickgrid in the Slickgrid-Universal monorepo; version 10 (March 2026) requires Angular 21 or later.

If you still have any queries, feel free to comment or message us directly via the contact form, and the Diatom Angular development team will be glad to help you with your Angular projects!

Related case study

reactjs app to track routes
Logistics and Transportation
Desktop, web, and mobile applications for a Swedish logistics company that automated daily routines, reduced manual errors, and increased transaction volume.

Related articles

Website Speed Why is this so important? Impact, Testi, Fixes
A slow page doesn't just annoy visitors - it costs revenue, rankings, and ad spend efficiency in ways most teams never trace back to their real cause. This guide covers what site speed actually affects, how to measure it correctly, and the fixes that move the needle.
Angular Development Outsourcing
Learn what to expect and what to avoid with angular development outsourcing. This guide helps you access top talent, manage costs, and prevent common pitfalls.
Best Headless CMS for Enterprise 2026: A Complete Guide
Discover the best headless CMS for enterprise 2026. Learn why traditional systems fail and how to select a scalable, API-first solution for your tech stack.
Web Development Services

Have a project in mind?

Web applications, portals and platforms that stay fast and secure as they grow.