Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/main_file/public/assets/js/pages/ drwxrwxrwx | |
| Viewing file: Select action/file-type: 'use strict';
// [ html-demo ]
const main = document.querySelector('#tree-demo');
const info = document.querySelector('#tree-msg');
const tree = new VanillaTree(main, {
contextmenu: [{
label: 'Hey',
action: function (id) {
alert('Hey ' + id);
}
}, {
label: 'Blah',
action: function (id) {
alert('Blah ' + id);
}
}]
});
tree.add({
label: 'Label A',
id: 'a',
opened: true
});
tree.add({
label: 'Label B',
id: 'b'
});
tree.add({
label: 'Label A.A',
parent: 'a',
id: 'a.a',
opened: true,
selected: true
});
tree.add({
label: 'Label A.A.A',
parent: 'a.a'
});
tree.add({
label: 'Label A.A.B',
parent: 'a.a'
});
tree.add({
label: 'Label B.A',
parent: 'b'
});
main.addEventListener('vtree-open', function (evt) {
info.innerHTML = evt.detail.id + ' is opened';
});
main.addEventListener('vtree-close', function (evt) {
info.innerHTML = evt.detail.id + ' is closed';
});
main.addEventListener('vtree-select', function (evt) {
info.innerHTML = evt.detail.id + ' is selected';
}); |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0047 ]-- |