1.5.28 • Published 1 year ago

flat-tree-builder v1.5.28

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Classifier

Only for es module, only for Postgres ltree data

Testing

npm i
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

Params object

  • getUrl: url for get
  • postClassifierUrl: url for post
  • delUrl: url for delete, default: postClassifierUrl
  • selectedIds: array of id's to be drawn initially
  • path: tree line, default: 'tree_path'
  • search: if the classifier is used for searching, type: Boolean, default: false
  • test: run with test data, type: Boolean, default: false
  • draggable: ability to drag and drop list items, type: Boolean, default: false
  • isRootSelectable: ability to select a root classifier, type: Boolean, default: true

Example

<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,
});

API

  • toggleManual(id) - open or close the classifier with the passed id
  • fillModalForm(text) - fill the field in the modal window with text from the parameters
  • clickModalBtn() - simulates clicking the send button in a modal window
  • getModalFormValue() - gets a string from a form in a modal window
  • findById(id) - returns html element bound to id
1.5.28

1 year ago

1.5.27

1 year ago

1.5.26

1 year ago

1.5.25

1 year ago

1.5.24

1 year ago

1.5.21

1 year ago

1.5.23

1 year ago

1.5.22

1 year ago

1.5.20

1 year ago

1.5.19

1 year ago

1.5.18

1 year ago

1.5.16

2 years ago

1.5.17

2 years ago

1.5.15

2 years ago

1.5.14

2 years ago

1.5.13

2 years ago

1.5.12

2 years ago

1.5.11

2 years ago

1.5.10

2 years ago

1.5.9

2 years ago

1.5.8

2 years ago

1.5.7

2 years ago

1.5.5

2 years ago

1.5.4

2 years ago

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.6

2 years ago

1.4.5

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.11

2 years ago

1.2.10

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago