slickgrid-colgroup-plugin
SlickGrid plugin to create column group in a header.
Installation
Node
npm install slickgrid-colgroup-plugin
// export function globally like belowvar colGroupPlugin =
When using with Browserify, babelify
and babel-preset-es2015
are required.
Browser
Download via npm
or releases and load standalone build version dist/slickgrid-colgroup-plugin.js
Usage
Register plugin:
grid.registerPlugin(new Slick.Plugins.ColGroup())
To specify a colmun group structure, extend the column definition to add children
property with array value, like so:
var columns = [
{id: 'col1', name: 'col 1', children: [
{id: 'col1-1', name: 'col 1-1', field: 'col1-1'},
{id: 'col1-2', name: 'col 1-2', field: 'col1-2'}
]},
{id: 'col2', name: 'col 2', children: [
{id: 'col2-1', name: 'col 2-1', field: 'col2-1'},
{id: 'col2-2', name: 'col 2-2', children: [
{id: 'col2-2-1', name: 'col 2-2-1', field: 'col2-2-1'},
{id: 'col2-2-2', name: 'col 2-2-2', field: 'col2-2-2'}
]}
]}
]
Test
npm install
npm run test
or open test/index with web browser which we want to test on after npm install
.
License
MIT (c) keik