![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/html/libs/absol-acomp/demo/ |
Upload File : |
<!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, user-scale=no"> <meta charset="UTF-8"> <title>SelectTreeLeafMenu</title> <script src="../dist/absol-acomp.js?<?php echo stat('../dist/absol-acomp.js')['mtime'];?>"></script> </head> <body> <style> body { min-width: 80vh; } </style> <script> var listDataAsync = fetch('./demo_tree_list_with_icon.js').then(function (res) { return res.text(); }).then(function (text) { var module = { exports: {} }; var factor = new Function('module', 'exports', text + '\nreturn module.exports;'); return factor(module, module.exports); }); var item3 = [ { value: 0, text: "Ngầm định", items: [ { value: 30189, text: "Tài chính", items: [] } ] }, { value: 1, text: "Điểm cộng, điểm trừ", items: [ { value: 30192, text: "Quy trình", items: [] } ] }, { value: 2, text: "Nghiên cứu khoa học", items: [ { value: 30190, text: "Khách hàng", items: [ { value: 40629, text: "s", items: [ { value: 40630, text: "ss", items: [], isLeaf: true } ], isLeaf: false } ] }, { value: 30193, text: "ffff", items: [] } ] } ]; listDataAsync.then(function (items) { var _ = absol._; var $ = absol.$; var items2 = JSON.parse(JSON.stringify(items)); items2.forEach(function visit(item) { item.isLeaf = item.icon.class.indexOf('mdi-account') >= 0; if (item.items) { item.items.forEach(visit); } }); // var box = _({ // tag: 'selecttreeleafbox', // props: { // items: items2, // enableSearch: true // }, // on: { // pressitem: function (event) { // this.value = event.item.value; // // console.log(event) // } // } // }).addTo(document.body); // var bt = _('<button>TARGET</button>').addTo(document.body); // box.followTarget = bt; // box.viewToSelected(); items2.unshift({ text:'--chon gia tri--', value:null, isLeaf: true }); console.log(items2) var menu = { tag: 'selecttreeleafmenu', props: { items: item3, enableSearch: true, nullValue: null, openValue: 19 }, on: { change: function () { absol.require('snackbar').show('change : ' + this.value); } } }; _({ tag: 'modal', child: { style: { minWidth: '50vw', height: '95vh', padding: '10px', border: '1px solid black', overflow: 'auto' }, child: [ {style: {height: '80vh'}}, menu, {style: {height: '80vh'}}, ] } }).addTo(document.body); }); </script> </body> </html>