Jstree state plugin not saving tree state

Amda picture Amda · Jan 30, 2014 · Viewed 8.3k times · Source

Adding the state plugin in Jstree is still not saving the state of the tree between page refresh or after clicking link and going back to previous page

$('#myGrid').jstree({
    "types": {
       "key": {
           "icon": "Content/Images/skey.png"
       },
       "value": {
           "icon": "Content/Images/sValue.png"
       }
    },
    "state": { "key": "myTree" },
    "search": { },
    "core": {
        "check_callback":true,
        "data": [@Html.Raw(Model.JsonData)]
    },
    "plugins": ["state", "types", "search"]

thank you,

Answer

Premshankar Tiwari picture Premshankar Tiwari · Jan 31, 2014

use set state property from the documentation...