Hi Friends..
I was looking a way to make another menu in CMS which will show my own tree structure (not the pages) in Silverstripe 3 ..
I know it uses the jstree for this,but i need a way to start,any help is appreciated.
Thanks
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi Friends..
I was looking a way to make another menu in CMS which will show my own tree structure (not the pages) in Silverstripe 3 ..
I know it uses the jstree for this,but i need a way to start,any help is appreciated.
Thanks
I added a div with id demo and i know that the jquery.jstree.js is included as soon as the cms is opened in silverstripe 3.
In the init() function u included the my javacrript to create the jstree in the div demo.
and my js code is this:
$("#demo").jstree({
"json_data" : {
"data" : [
{
"data" : "A node",
"metadata" : { id : 23 },
"children" : [ "Child 1", "A Child 2" ]
},
{
"attr" : { "id" : "li.node.id1" },
"data" : {
"title" : "Long format demo",
"attr" : { "href" : "#" }
}
}
]
},
"plugins" : [ "themes", "json_data", "ui" ]
}).bind("select_node.jstree", function (e, data) { alert(data.rslt.obj.data("id")); });
But i am not able to show any tree in the demo div.
May be i am missing any file or may be some other issue,i am not abe to find any javascript error in console.
Can someone help me with this please?
Thanks
Hi SS_Learner,
did you find any solution for your problem?
Best regards,
chrclaus
Hi chrclaus..
I was able to do this jstree in silverstripe 3 CMS,my issue at that time was my javascript for the js tree was loading after the div making the jstree..
Then i included my jstree javascript code in ss file,and it all worked as i wanted to..
Thanks
Hi SS_Learner,
is it possible for you to explain your solution more in detail? I have no idea where to start (which class I should extend ...). I think, modelAdmin is not the richt choice, isn´t it?
Best regards,
chrclaus