1. The reason for the fix is that the treeview control is used in an android project (a token was originally implemented through the native api of android .). Originally, there were many excellent tree controls in js plug-ins, such as the famous ztree in China and the built-in tree of various ui controls. However, the simplest and easiest way to use data is to use the most classic jquery. treeview. And the animation effect is also good, I just took a fancy to its light, the animation effect is good, but also relatively easy to use .. (Other trees have not been touched yet ..)., So we use it. 2. The method to add a subnode to jquery. treeview during the fix process is View Code, but this method has a serious problem, that is, the added node must only be li. If a child node is inserted to a node without a child node, the expand button of the node does not exist, that is, the parent event is not bound .. As a result, it was useless to write several hack statements based on this idea, so I went to the source code .. Fortunately, there are not many codes of great gods. Although there are still several distances from the Earth to the Moon to understand the codes of great gods at the current level, but fortunately there are not many codes of great gods, and we can also find them using ctrl + F. Add a few lines of code here ..
Var branch = $ ("<li> <span> child1 </span> </li> "). appendTo (parentLi); $ ("# tree "). treeview ({add: branch });
A successful outbreak of character!