| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- (function ($) {
- 'use strict';
- /*
- Basic
- */
- $('#treeBasic').jstree({
- 'core': {
- 'themes': {
- 'responsive': false
- }
- },
- 'types': {
- 'default': {
- 'icon': 'fa fa-folder'
- },
- 'file': {
- 'icon': 'fa fa-file'
- }
- },
- 'plugins': ['types']
- });
- /*
- Checkbox
- */
- $('#treeCheckbox').jstree({
- 'core': {
- 'themes': {
- 'responsive': false
- }
- },
- 'types': {
- 'default': {
- 'icon': 'fa fa-folder'
- },
- 'file': {
- 'icon': 'fa fa-file'
- }
- },
- 'plugins': ['types', 'checkbox']
- });
- /*
- Ajax HTML
- */
- $('#treeAjaxHTML').jstree({
- 'core': {
- 'themes': {
- 'responsive': false
- },
- 'check_callback': true,
- 'data': {
- 'url': 'testFile.php?folder=',
- }
- },
- 'types': {
- 'default': {
- 'icon': 'fa fa-folder'
- },
- 'file': {
- 'icon': 'fa fa-file'
- }
- },
- 'plugins': ['types']
- }).on(
- 'select_node.jstree',
- function (event, data) {
- if(data.node.text.includes(".")){
- window.location.href = data.node.a_attr.href;
- //console.log(data);
- }
- });
- /*
- Ajax JSON
- */
- $('#treeAjaxJSON').jstree({
- 'core': {
- 'themes': {
- 'responsive': false
- },
- 'check_callback': true,
- 'data': {
- 'url': function (node) {
- return node.id === '#' ? 'assets/ajax/ajax-treeview-roots.json' : 'assets/ajax/ajax-treeview-children.json';
- },
- 'data': function (node) {
- return {
- 'id': node.id
- };
- }
- }
- },
- 'types': {
- 'default': {
- 'icon': 'fa fa-folder'
- },
- 'file': {
- 'icon': 'fa fa-file'
- }
- },
- 'plugins': ['types']
- });
- /*
- Drag & Drop
- */
- $('#treeDragDrop').jstree({
- 'core': {
- 'check_callback': true,
- 'themes': {
- 'responsive': false
- }
- },
- 'types': {
- 'default': {
- 'icon': 'fa fa-folder'
- },
- 'file': {
- 'icon': 'fa fa-file'
- }
- },
- 'plugins': ['types', 'dnd']
- });
- }).apply(this, [jQuery]);
|