Api for file organization similar to tree structure

Asked

Viewed 105 times

2

I am developing a meeting module, which contains management of staves, the staves are organized as follows:

1. pauta c
    1.1.pauta x
2. pauta v
    2.1. pauta b
      2.1.1. pauta y

Each staff of this is a record in the database. I tried several ways, with Jquery, Javascript with arrays, Datatables, but I was not successful. In this module I need to implement the option to change and delete staves. For example, it has to be possible for the user to select (click) a staff and click another button to turn it into a sub-topic or just leave it as a topic. When modeling the system, Agreedo was used as a model. As far as I understand this structure is tree. However I am looking for something simpler.

Agreedo exemplo

The question is, I would like to know if there is an Api . js that assists me in this development. Preferably one that abstracts this part of the tree. If not, I’d like an idea with logic.

1 answer

1


Once I needed to do something like what you need.
In my case I needed to make a tree of an URA for PABX and in each item of the tree I needed to fire an onClick event.
I used Jstree, I found it very basic and easy to manipulate.
Follow the link: https://www.jstree.com/

Just remember, Jstree doesn’t create events, etc (at least I didn’t create it for him), that part I had to do by hand. Jstree will just take the data and show as tree format.
Here’s an example of what my data tree looked like:

Exemplo de arvore

  • That’s not quite what I expect. But it seems that with this structure you can do.. I’ll try to do with it, to see what happens. Then I put the results here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.