$('#areatree').jstree({ 'core': { "check_callback": true, 'data': { 'url': 'getallareas?excludeTables=false' }, "themes": { "variant": "large", }, }, "state": {"key": '<%=Request.QueryString["type"]%>_infotree'}, "types": { default: { "max_children": 10000, "max_depth": 10, "icon": "glyphicon glyphicon-th" }, "#": { "valid_children": ["Area"], "icon": "glyphicon glyphicon-th", }, "Area": { "icon": "glyphicon glyphicon-th", "valid_children": ["Pit", "Area"] }, "Pit": { "icon": "glyphicon glyphicon-th-list", "valid_children": ["Table"] }, "Table": { "icon": "glyphicon glyphicon-minus", "valid_children": [] } }, "dnd": { check_while_dragging: true, }, "plugins": ["contextmenu", "dnd", "state", "search", "sort", "type", "unique"]});
{
"id":"ff80818143e87a7b0143e8ebec2d0005",
"text":"Area1",
"icon":"glyphicon glyphicon-th-large",
"state":{"opened":false,"disable":false,"selected":false},
"li_attr":{},"a_attr":{"type":"area"},
"type":"Area",
"children":[
{"id":"ff808181463de59801463ded08050002",
"text":"Pit2",
"icon":"glyphicon glyphicon-th-list",
"state":{"opened":false,"disable":false,"selected":false},
"li_attr":{},
"a_attr":{"type":"area"},
"type":"Pit","children":[],
"parentId":"ff80818143e87a7b0143e8ebec2d0005",
"hasChildren":true,
"movable":true,
"name":"Pit1"
}
],
"parentId":"ff80818143103928014310392a350003",
"hasChildren":true,
"movable":true,
"name":"Area1"}
The type is not read off of therelattribute. Try using<li data-jstree='{ "type" : "floor" }'...in your markup (and keep the single quotes outside, and the double quotes - inside for thedata-jstreeattribute).
https://github.com/vakata/jstree/issues/497
data-jstree="'{ "type" : "floor" }'"
or
data-jstree="{ 'type' : 'floor' }"
<li role="treeitem" data-jstree="{ 'type' : 'Area' }" aria-expanded="false" id="ff80818145606a6b014593cb961b001d" class="jstree-node jstree-closed" aria-selected="false">