


In a previous company’s internal management system (InnerOA), I used dTree for the structure of the directory tree to achieve unlimited directory display and right-click menu functions (the right-click menu includes: create, modify, share, delete, Refresh and other functions, as shown in the picture below)
Some knowledge about the directory tree in the company's internal management system (InnerOA) will be compiled and provided with source code when there is time.
But the only regret about dTree is that it does not support the drag and drop sorting function, which has been a problem that I have been struggling with after completing InnerOA. After checking some content about directory trees on the Internet, dTree is the one that I currently think is most suitable for my project. By chance, I discovered another powerful directory tree, which is what this article refers to: dhtmlxTree, which supports drag and drop functions. However, I did not find similar DEMO or functions in the source code. I only found that it provides a parameter to enable drag and drop, but , which also made me determined to solve the drag-and-drop sorting problem of the directory tree, so I spent some time studying the source code and combined with the experience summarized in the dTree project, and finally realized my needs: free drag-and-drop sorting, transplantation of dTree's right-click menu function, and realizes right-clicking on the selected directory and popping up the menu. You can perform the following operations based on the current directory:
1. Create a new directory under this directory
2. Modify the current directory name
3. Delete the current directory
4. Refresh the page
5. Other functions can be added, such as "sharing". In the company's internal management system (InnerOA), I use the sharing of the Windows operating system as a prototype, set up "self-reading sharing" or "writable sharing", and can specify sharing to a certain user (or multiple users or even all users). In this way, only the users who set up sharing can see the shared content.
Since it is not possible to demonstrate online, here are a few pictures to illustrate (source code download: http://download.csdn.net/detail/zm2714/4544616):
1. You can right-click on any directory to create a new directory
2. You can right-click on any directory to modify the current directory. Except for the root directory.
The above picture explains: The root directory cannot be modified, that is, the Books in the picture cannot be modified. This id value is -1. This is a special ID. Flag is the root directory.
The above picture explains: Any other directory can be modified. In actual use, it is the ID value of the directory in the database. In the above figure, the ID value of "directory ccc" is 3.
Instructions for the above picture: After modifying the name, click Save.
3. You can drag any directory other than the root directory and sort by dragging.
Drag-and-drop sorting principle: When dragging the directory to be selected to its parent directory, its time is updated to the current time. Sort by time DESC. This will appear first in the "parent directory". Loop this operation to achieve the sorting function.
2. Code implementation
1. Reference js files and style files
2. Program implementation
|
Some comment statements in the above source code can be restored during testing and the required values can be viewed. It is helpful to understand the functions described in this article and quickly apply them to your actual projects. Communication is also welcome.
The detailed use of dhtmlXTree is beyond the scope of this article. You can refer to the online tutorials on using dhtmlXTree.

当我们鼠标暂时失去作用的时候,如何用键盘快捷键的方式打开右键菜单呢?有两种方法,一是按Shift+F10快捷键就可以调处右键菜单,二是键盘上windows和ctrl中间带着目录的键也可以,具体的教程下面一起来看看吧。用键盘快捷键打开右键菜单的方式第一种方法1、在电脑桌面中不选择任何文件时,按下键盘上的下图红色圈标注的按键,此按键为快捷打开右键菜单的按键。2、即可将桌面的右键菜单打开,如果需要选择其中的项目,再用鼠标选中即可第二种方法1、其实我们使用“Shift+F10”快捷键就可以调处右键菜单2

在Windows11中,“开始”菜单经过重新设计,并具有一组简化的应用,这些应用排列在页面网格中,这与它的前身不同,后者在“开始”菜单上有文件夹、应用和组。您可以自定义“开始”菜单布局,并将其导入并导出到其他Windows设备,以根据您的喜好对其进行个性化设置。在本指南中,我们将讨论在Windows11上导入开始布局以自定义默认布局的分步说明。什么是Windows11中的Import-StartLayout?导入开始布局是Windows10和更早版本中使用的cmdlet,用于将“开始”菜单的自定
![右键单击无法在Word或PowerPoint中工作[修复]](https://img.php.cn/upload/article/000/887/227/170901479016252.jpg)
一些Office用户报告说,他们的鼠标右键在Word和PowerPoint中无法正常工作。当他们右击文档中的空白处或元素时,他们不会得到任何上下文菜单,其中包含粘贴选项、字体、格式化背景、格式化图片、新建注释等选项。一些用户报告说,当他们按鼠标右键时,上下文菜单会出现1-2秒,然后在他们单击任何选项之前迅速消失。为什么我的右击在MicrosoftOffice中不起作用?如果右键单击在Word、PowerPoint等Office应用程序中不起作用,通常是第三方加载项导致的。如果您的鼠标未处于正确的

很多使用win10系统的小伙伴发现,打开桌面右键的时候,里面没有用管理员身份运行的选项,那么我们该如何恢复这个选项呢?其实我们只要在设置里把账户禁用关闭就可以了,具体的教程一起来看看吧。恢复Win10右键以管理员身份运行的方法1、在桌面右击此电脑也就是我的电脑,选择“管理”。2、展开至计算机管理——系统工具——本地用户和组——用户,在右侧找到并打开Administrator。3、在Administrator属性界面中,取消勾选“帐户已禁用”,点击确定即可。4、完成设置后,之后在Administr

我们用户从来不想要的最烦人的更改之一是在右键单击上下文菜单中包含“显示更多选项”。但是,您可以删除它并取回Windows11中的经典上下文菜单。不再需要多次单击并在上下文菜单中查找这些ZIP快捷方式。按照本指南返回Windows11上成熟的右键单击上下文菜单。修复1–手动调整CLSID这是我们列表中唯一的手动方法。您将在注册表编辑器中调整特定键或值以解决此问题。注意–像这样的注册表编辑非常安全,并且可以正常工作。因此,在系统上尝试此操作之前,您应该创建注册表备份。步骤1–尝试

很多使用win10系统的小伙伴点击鼠标右键打开新建的时候,发现没有nvidia控制面板,这是怎么一回事呢?其实不是什么大问题,把设置更改一下就可以了,今天小编教你们如何进入设备管理设置nvidia控制面板,具体的教程下面一起来看看吧。恢复右键nvidia控制面板的方法1、右键单击此电脑选择属性,如下图所示2、进入管理界面,点击设备管理器,如下图所示3、进入设备管理器,点击显示适配器,如下图所示4、进入显示适配器,右键单击N卡,选择启动设备,如下图所示5、接着进入服务和应用程序,点击服务,找到nv

如果我们不满意自己的右键菜单内容,不管是太多还是太少其实都是能更改的,那么win10右键菜单栏怎么设置呢,其实只要打开注册表就可以了。win10右键菜单栏怎么设置:1、首先使用“win+r”快捷键打开运行。2、打开后在其中输入“regedit”并回车打开注册表。3、然后进入上方“HKEY_CURRENT_USER\Software\Microsoft\InternetExplorer\MenuExt”路径。4、在左边“MenuExt”文件夹下就是右键菜单栏内容了。5、不要的可以右键“删除”6、想

iPhone上的原生“信息”应用可让您轻松编辑已发送的文本。这样,您可以纠正您的错误、标点符号,甚至是自动更正可能已应用于您的文本的错误短语/单词。在这篇文章中,我们将了解如何在iPhone上编辑消息。如何在iPhone上编辑消息必需:运行iOS16或更高版本的iPhone。您只能在“消息”应用程序上编辑iMessage文本,并且只能在发送原始文本后的15分钟内编辑。不支持非iMessage信息文本,因此无法检索或编辑它们。在iPhone上启动消息应用程序。在“信息”中,选择要从中编辑消息的对话


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

WebStorm Mac version
Useful JavaScript development tools

Notepad++7.3.1
Easy-to-use and free code editor

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.