# @kanety/jquery-simple-tree-table

> A jquery plugin that attaches tree-like behaviour to table

Latest version **0.5.1** (published 2020-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kanety/jquery-simple-tree-table
pnpm add @kanety/jquery-simple-tree-table
yarn add @kanety/jquery-simple-tree-table
bun add @kanety/jquery-simple-tree-table
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2020-07-11 |
| First published | 2018-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 34.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Yoshikazu Kaneta |
| Maintainers | kanety |
| Keywords | jquery, jquery-plugin, table, tree |

## Links

- npm: https://www.npmjs.com/package/@kanety/jquery-simple-tree-table
- Repository: https://github.com/kanety/jquery-simple-tree-table
- Homepage: https://github.com/kanety/jquery-simple-tree-table#readme
- Issues: https://github.com/kanety/jquery-simple-tree-table/issues
- npm.io page: https://npm.io/package/@kanety/jquery-simple-tree-table

## Dependencies (2)

- [jquery](https://npm.io/package/jquery.md) ^3.3.1
- [@kanety/js-store](https://npm.io/package/@kanety/js-store.md) ^0.1.2

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 0.5.1 (latest) — 2020-07-11
- 0.5.0 — 2019-10-21
- 0.4.1 — 2019-10-05
- 0.4.0 — 2019-06-25
- 0.3.3 — 2019-05-07
- 0.3.2 — 2019-02-22
- 0.3.1 — 2019-01-29
- 0.3.0 — 2019-01-28
- 0.2.0 — 2018-12-24
- 0.1.0 — 2018-12-10

## README

# jquery-simple-tree-table

A jquery plugin that attaches tree-like behaviour to table.

## Dependencies

* jquery

## Installation

Install from npm:

    $ npm install @kanety/jquery-simple-tree-table --save

## Usage

Add `data-node-id` and `data-node-pid` in your table:

```html
<table>
  <tr data-node-id="1">
    <td>1</td>
    <td>text of 1</td>
  </tr>
  <tr data-node-id="1.1" data-node-pid="1">
    <td>1.1</td>
    <td>text of 1.1</td>
  </tr>
  <tr data-node-id="1.1.1" data-node-pid="1.1">
    <td>1.1.1</td>
    <td>text of 1.1.1</td>
  </tr>
  <tr data-node-id="1.1.2" data-node-pid="1.1">
    <td>1.1.2</td>
    <td>text of 1.1.2</td>
  </tr>
</table>
```

Then run:

```javascript
$('table').simpleTreeTable();
```

### Options

Specify opened nodes:

```javascript
$('table').simpleTreeTable({
  opened: [1]
});
```

Add expand / collapse button:

```javascript
$('table').simpleTreeTable({
  expander: '#expander',
  collapser: '#collapser',
});
```

Customize icon position:

```javascript
$('table').simpleTreeTable({
  iconPosition: 'td:last-child'
});
```

Store node states in sessionStorage or localStorage:

```javascript
$('table').simpleTreeTable({
  store: 'session', // or 'local'
  storeKey: 'KEY'
});
```

### Callbacks

Run Callbacks when a node is opened or closed:

```javascript
$('table').simpleTreeTable({
  ...
}).on('node:open', function(e, $node) {
  ...
}).on('node:close', function(e, $node) {
  ...
});
```

## License

The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

---
_Source: https://npm.io/package/@kanety/jquery-simple-tree-table · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
