7912 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » DOM and Hierarchy
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 628 Views |
-
DOM and Hierarchy

4 August 2011 at 2:14pm
Hello,
I want to manage report categories in a tab in report-holder using the DOM. Categories have a parent id and many child id's - they are hierarchical
Is it possible to use DOM to manage these? And if so, how do you get it to show the nesting / hierarchy? So far, I have a DOM showing the categories with a pop up with fields name & parentid. But the hierarchy dosn't show in the table at all.
Thanks
will
-
Re: DOM and Hierarchy

4 August 2011 at 2:37pm
What you can do is add a DOM for the category itself or make a checkbox list to show in the popup. As far as I know the DOM can't show several levels in a hierarchy in a meaningful way, it will just show you a flat list of categories.
What you can do though is affect how the DOM writes the category names by making your own function for it and putting that in the field list. Then you could do something like what WordPress does where a sub category gets a - before the name and a sub sub category gets -- etc. After that you'd want to do some kind of custom sorting to get them to list in a good way I guess.
-
Re: DOM and Hierarchy

4 August 2011 at 2:41pm
Hmm, ok thanks. good idea.
Really though I want to avoid a lot of custom hacking if possible. I feel like im missing something. Silver-stripe must have a native way of dealing with hierarchical categories surely?
-
Re: DOM and Hierarchy

5 August 2011 at 1:05am
As far as I know there's no native way of dealing with it if we by native mean plug and play. Getting it to show the nesting isn't hard though and the function you'd have to write for it wouldn't have to be many lines. You do have two special select lists that show hierarchical content, the one built in that's used in the access tab and UncleCheese has one called SimpleTreeDropdownField that does pretty much the same thing.
Uncle Cheese has made a couple of new ones recently and maybe one of them could help you out, I don't know. Anyways, don't be afraid to get your hands dirty with some code.
| 628 Views | ||
|
Page:
1
|
Go to Top |

