Vanilla Installation
1. Install NPM Package
npm install --save @slickgrid-universal/common
# install whichever UI framework you want to use like Bootstrap, Bulma, ...
npm install bootstrap2. Create a basic grid
<h1>My First Grid</h1>
<div class="grid1">
</div>import { Column, GridOption, Slicker } from '@slickgrid-universal/common';
export class GridBasicComponent {
columnDefinitions: Column[] = [];
gridOptions: GridOption = {};
constructor() {
this.prepareGrid();
}
mounted() {
const container = document.querySelector(`.grid1`) as HTMLDivElement;
this.sgb = new Slicker.GridBundle(container, this.columnDefinitions, this.getData());
}
getData() {
// ...
}
prepareGrid() {
this.columnDefinitions = [
{ id: 'title', name: 'Title', field: 'title', sortable: true },
{ id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true },
{ id: '%', name: '% Complete', field: 'percentComplete', sortable: true },
{ id: 'start', name: 'Start', field: 'start' },
{ id: 'finish', name: 'Finish', field: 'finish' },
];
this.gridOptions = {
enableAutoResize: true,
enableSorting: true
};
// fill the dataset with your data (or read it from the DB)
this.dataset = [
{ id: 0, title: 'Task 1', duration: 45, percentComplete: 5, start: '2001-01-01', finish: '2001-01-31' },
{ id: 1, title: 'Task 2', duration: 33, percentComplete: 34, start: '2001-01-11', finish: '2001-02-04' },
];
}
}3. CSS / SASS Styles
CSS
SASS (scss)
4. Explore the Documentation
5. Get Started
6. CSP Compliance
Last updated