maddmac Posted June 10, 2020 Share Posted June 10, 2020 Is there any sort of module that emulates a tree? For example. I want to be able to be able to visual create an organizational tree. This would allow drag and drop organization of elements in the tree Like this example https://mbraak.github.io/jqTree/examples/03_drag_and_drop/ I would then return the results in an array Link to comment Share on other sites More sharing options...
Robin S Posted June 10, 2020 Share Posted June 10, 2020 5 hours ago, maddmac said: Is there any sort of module that emulates a tree? Not exactly a module, but the page tree emulates a tree, allows drag and drop organisation of elements, and returns results as a (Page)Array. ? 5 hours ago, maddmac said: Like this example https://mbraak.github.io/jqTree/examples/03_drag_and_drop/ You could also use exactly that example. If you are talking about the frontend then PW doesn't place any limitations on what JS libraries you can use. And you could use it in the backend too if needed, via RuntimeMarkup for example. 1 Link to comment Share on other sites More sharing options...
Robin S Posted June 11, 2020 Share Posted June 11, 2020 I just noticed that the topic title mentions field type. The jqTree library you linked to can read/write to/from JSON format, so that data can be stored in a FieldtypeTextarea. For the inputfield you could create a custom inputfield module that extends InputfieldTextarea - in the renderReady() and render() methods you would make use of jqTree. If you are not up for coding that another idea is to use the depth option available for Repeater fields. If you go this route you might also find my Repeater Depth Helper module useful. 4 Link to comment Share on other sites More sharing options...
kongondo Posted June 11, 2020 Share Posted June 11, 2020 7 hours ago, Robin S said: depth option available for Repeater fields. Uh? Never knew about this ? When did this become a thing? Sorry for interrupting... ? Link to comment Share on other sites More sharing options...
Robin S Posted June 11, 2020 Share Posted June 11, 2020 3 minutes ago, kongondo said: When did this become a thing? Ryan introduced it at the end of 2016. In my mind it doesn't seem like that long ago. I must be getting old. ?https://processwire.com/blog/posts/pw-3.0.44-repeaters/ 2 Link to comment Share on other sites More sharing options...
kongondo Posted June 11, 2020 Share Posted June 11, 2020 28 minutes ago, Robin S said: I must be getting old That's me. Memory's gone! 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now