You need to sign in to do that
Don't have an account?
mriz
How to Pass values (List/Map) from Apex to JavaScript/Jquery
I have a requirement wherein i want to pass values from Apex to Javascript/jQuery. I want to add some properties to the values received in jQuery and then add those values on VF page.
(I want to create hierarchy of a custom object record which can be related to different objects and the level of depth and width is n).
(I want to create hierarchy of a custom object record which can be related to different objects and the level of depth and width is n).
You can Learn from here.
https://developer.salesforce.com/page/Getting_Started_with_Apex_JSON
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_Json.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_System_JsonGenerator.htm
regarding JSON Hadling You can learn from above links. If you want to create a hierarchy you can gererate a json like
[
{ "name":"abilash" , "nickname" :"mishra", "childrens":
[
{ "name":"child1" }
]
}]
transfer this to javascript and all set.
Let me Know if you are lacking
Happy to help.
Please upvote if this helps.