Classifier
Only for es module, only for Postgres ltree data
Testing
npm t
Integration
Download
npm i flat-tree-builder
html
- Create an element on the page where the element will be embedded, assign an id to the element
js
- Import the Classifier class from classifier.js
- Create an instance of the Classifier class, where the first parameter is the item id and the second parameter is the object with the parameters
css
- Connect the classifier.css file
- Connect bootstrap
Объект с параметрами
- getUrl: url for get
- postClassifierUrl: url for post
- search: if the classifier is used for searching
- test: run with test data
- selectedIds: array of id's to be drawn initially
- draggable: drag and drop list items
Пример
<link
rel="stylesheet"
href="./node_modules/bootstrap/dist/css/bootstrap.min.css"
/>
<link rel="stylesheet" href="./node_modules/flat-tree-builder/classifier.css" />
<div id="test"></div>
import Classifier from "flat-tree-builder";
const classifier = new Classifier("#test", {
test: true,
search: true,
});