Ajout type (jstree)

This commit is contained in:
2021-02-15 10:42:07 +01:00
parent 2f0b32e25d
commit 35cdda57ae

View File

@@ -8,34 +8,10 @@ function Quit()
document.getElementById('formAction').submit();
}
// Main Page
// $(function() {
// $(function() {
// $.contextMenu({
// selector: '#RootDN',
// callback: function(key, options) {
// var m = "clicked: " + key;
// window.console && console.log(m) || alert(m);
// },
// items: {
// "edit": {name: "Edit", icon: "edit"},
// "cut": {name: "Cut", icon: "cut"},
// copy: {name: "Copy", icon: "copy"},
// "paste": {name: "Paste", icon: "paste"},
// "delete": {name: "Delete", icon: "delete"},
// "sep1": "---------",
// "quit": {name: "Quit", icon: function(){
// return 'context-menu-icon context-menu-icon-quit';
// }}
// }
// });
// $('.context-menu-one').on('click', function(e){
// console.log('clicked', this);
// })
// });
$(function() {
/**
* Page load
*/
$(function() {
$('#jsTree')
.jstree({
'core' : {
@@ -72,14 +48,25 @@ function Quit()
}
},
"types" : {
"default" : {
"icon" : "fas fa-globe-europe"
"#" : {
"max_children" : 1,
"max_depth" : 4,
"valid_children" : ["root"]
},
"demo" : {
"icon" : "glyphicon glyphicon-ok"
"root" : {
"icon" : "/static/3.3.11/assets/images/tree_icon.png",
"valid_children" : ["default"]
},
"default" : {
"valid_children" : ["default","file"]
},
"file" : {
"icon" : "glyphicon glyphicon-file",
"valid_children" : []
}
},
"plugins" : ["contextmenu","dnd","search"]
});
});
// https://www.jstree.com/demo/