You need to sign in to do that
Don't have an account?
Sachin10
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 :)
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 :)
https://developer.salesforce.com/forums/?id=906F00000009kLrIAI
All Answers
https://developer.salesforce.com/forums/?id=906F00000009kLrIAI
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.