Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koss-lebedev/nested-inputs
https://github.com/koss-lebedev/nested-inputs
bootstrap component inputs tree-structure
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/koss-lebedev/nested-inputs
- Owner: koss-lebedev
- License: mit
- Created: 2017-02-20T19:39:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-05T19:21:38.000Z (over 7 years ago)
- Last Synced: 2024-10-10T01:14:12.402Z (about 1 month ago)
- Topics: bootstrap, component, inputs, tree-structure
- Language: JavaScript
- Size: 259 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nested-inputs
[![Code Climate](https://codeclimate.com/github/koss-lebedev/nested-inputs/badges/gpa.svg)](https://codeclimate.com/github/koss-lebedev/nested-inputs)
[![npm version](https://badge.fury.io/js/nested-inputs.svg)](https://badge.fury.io/js/nested-inputs)
[![Bower version](https://badge.fury.io/bo/nested-inputs.svg)](https://badge.fury.io/bo/nested-inputs)This control allows you create structure of nested text entries,
kind of like an editable tree.## Example
![nested-inputs](demo.gif)
## Installation
Using Bower:
bower install nested-inputs
Using NPM:
npm install nested-inputs
Or simply copy `nested-inputs.js` and `nested-inputs.css` files from `dist`
folder to your project.## Usage
```js
$('#categories').nestedInputs();
```To initialize it with existing tree data, set the value to JSON
value before calling `nestedInputs()`:
```js
var data = JSON.stringify([
{ value: "first", children: [
{ value: "subcategory 1", children: [] },
{ value: "subcategory 2", children: [
{ value: 'third-level nesting' },
{ value: 'third-level nesting 2' }
] }
] },
{ value: "second", children: [] }
]);
$('#categories').val(data).nestedInputs();
```
## LicensePlease see [LICENSE](LICENSE) for licensing details.