function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sachin10Sachin10 

JSTree not working in Visualforce Page

Hi All,
I'm trying to display JSON DATA in tree structure in my Visualforce Page.
CODE SNIPPET:
<apex:page showHeader="false" sidebar="false">

<apex:includescript value="{!URLFOR($Resource.JqueryTree, 'vakata-jstree-e22db21/dist/libs/jquery.js')}"/>
<apex:includescript value="{!URLFOR($Resource.JqueryTree, 'vakata-jstree-e22db21/dist/jstree.min.js')}"/>
<apex:includescript value="{!URLFOR($Resource.JqueryTree, 'vakata-jstree-e22db21/src/jstree.contextmenu.js')}"/>
<apex:stylesheet value="{!URLFOR($Resource.JqueryTree, 'vakata-jstree-e22db21/dist/themes/style.css')}"/>


<script>
var jsonDataHolder;
$(document).ready(function(){
jsonDataHolder =[
       { "id" : "ajson1", "parent" : "#", "text" : "Simple root node" },
       { "id" : "ajson2", "parent" : "#", "text" : "Root node 2", },
       { "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" },
       { "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" },
    ];

$('#jstree_demo').jstree({
  "core" : {  
    'data' : jsonDataHolder
  } ,
   "plugins" : [ "contextmenu" ]
});
});

</script>
<div id="jstree_demo"/>
</apex:page>

Problem: The child nodes are not getting displayed.

I have downloaded the Jquery files from  "http://www.jstree.com/ ".

Any pointers/Suggestion are most welcome.
Many thanks in advance  :)
Best Answer chosen by Sachin10
Ramu_SFDCRamu_SFDC
Check my reply to your question at your post below

https://developer.salesforce.com/forums/?id=906F00000009kLrIAI

All Answers

Ramu_SFDCRamu_SFDC
Check my reply to your question at your post below

https://developer.salesforce.com/forums/?id=906F00000009kLrIAI
This was selected as the best answer
Sachin10Sachin10
Thank u :)
thisisnotaprilthisisnotapril
As a reminder, one post please. Duplicate posts will be deleted.
Ricky MartinRicky Martin

Hi Sachin10 & Ramu_SFDC,

I am using above the code and resource. I would like to make the reeview account with contact so how to implement with above the code. I am new to salesforce. Please help to achieve this.