jQuery DataTables plugin for rendering nested DataTables in rows. Inner tables are independent of the data and layout from the outer table.
npm install nested-datatablesjQuery DataTables plugin for rendering nested DataTables in rows. Inner tables are independent of the data and layout from the outer table.
Download the latest version and include nested.datatables.min.js file
```
$ npm install nested-datatables
`js`
var table = new nestedTables.TableHierarchy("example", data, settings);
table.initializeTableHierarchy();
Main NestedTables constructor.
#### wrapperID
Type: String
ID of a DOM element where will be table hierarchy rendered.
#### data
Type: Array.
Data used for building table hierarchy. Each item consists of property data and property kids, which represents array of child elements.
Check examples below how to define json data.
#### settings
Type: Object
Settings for jQuery DataTables constructor.
Build nested table hierarchy.
#### onShowChildHierarchy
Triggered when a child hierarchy is shown
`js`
// '#example' is wrapper ID for table hierarchy
var tableEle = document.querySelector("#example .table");
tableEle.addEventListener("onShowChildHierarchy", function (e) {
console.log(e);
});
#### onHideChildHierarchy
Triggered when a child hierarchy is hidden
`js`
// '#example' is wrapper ID for table hierarchy
var tableEle = document.querySelector("#example .table");
tableEle.addEventListener("onHideChildHierarchy", function (e) {
console.log(e);
});
`html
`
`html
``
MIT © Andrej Gajdos