I am using jstree 3.0 , I want to customize my context menu like Add Folder , Add File as individual action.
Add File is the last it has no children, i want to store this as file in DB.
In the jstree 1.0 version i can able to attain this , because there is a rel which differentiate the file/folder, follow previous version code ,
Code:
	
"create" : {
			"separator_before"	: false,
			"separator_after"	: true,
			"label"			: "Add Category",
			"action"			 : function (obj) { this.create(obj, "last", {"attr" : { "rel" : "folder"}}); }
		},
		 "create_root": {					
			"seperator_before"	: false ,
			"seperator_after"	: false, 
			"label"			: "Add Product", 
			"action" 			: function (obj) {this.create(obj, "last", {"attr" : {"rel" : "default"}});}
},
For the new version i cant able to differentiate the file and folder , Here is my current version(3.0) code follows,
Code:
"contextmenu": {
"items": function($node) {
	var tree = $("#tree").jstree(true);
	return {
		"create" : {
			"separator_before"	: false,
			"separator_after"	: true,
			"label"			: "Add Folder",
			"action"			 : function (obj) { $node = tree.create_node($node); tree.edit($node); }
		},
		 "create_root": {					
			"seperator_before"	: false ,
			"seperator_after"	: false, 
			"label"			: "Add File", 
			"action" 			: function (obj) {this.create(obj, "last", {"attr" : {"rel" : "default"}});}
		}
};
}
}
With the above code i can able to add folder, but i can't able to add file because there is no rel.
If i want to add any folder/file(rel='file/folder') differentiating parameter in the code , where should i add it. Please give any suggestion ......