Recently, a category management function has been completed in the project. This function is similar to menu management and has four levels at most. Finally, ztree is used for implementation, however, you need to modify the style and control its functions. The main functions are:
1. subcategories can be added for the first three levels.
2. Level 4 category not added
3. the Edit (modify name) function is available for each level-1 category.
4. the last level category has the deletion function, and the parent category with sub-categories has the deletion function removed.
5. perform drag-and-drop sorting between the same-level categories
6. Add a top-level category
7. Expand All and contract all functions
Based on the seven functions above, ztree is a strong plug-in and has good compatibility, so after investigation, I also used the powerful ztree plug-in. The following uses this function as an example to record the use of ztree with several short blogs, this includes integrating springmvc + spring + mybatis to add, delete, modify, and query databases. It also hopes to help new users who want to use ztree but have never used ztree.
Article 1: A Brief Introduction to ztree, integrating some ztree functions and demo
Article 2: ztree, springmvc, spring, and mybatis integration for addition, deletion, modification, and query
Article 3: ztree achieves same-level drag-and-drop sorting and saves the sorting result to the database