The Javascript spreadsheet with Angular




Source code

Click here to see the project running on codesandbox.



Source code

import { Component } from "@angular/core";
import * as jexcel from "jexcel";

require("jexcel/dist/jexcel.css");

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.css"]
})
export class AppComponent {
  title = "CodeSandbox";

  ngAfterViewInit() {
    jexcel(document.getElementById("spreadsheet"), {
      data: [[]],
      columns: [
        { type: "dropdown", width: "100px", source: ["Y", "N"] },
        { type: "color", width: "100px", render: "square" }
      ],
      minDimensions: [10, 10]
    });
  }
}