Bootstrap-treeview custom double-click event implementation method_javascript skills

Source: Internet
Author: User
This article mainly introduces how to implement the bootstrap-treeview Custom Event double-click event, for more information, see bootstrap-treeview. It is a very cool jQuery Multi-Level list tree plug-in based on bootstrap. Based on Twitter Bootstrap, The jQuery plug-in displays some inherited tree structures, such as view trees and list trees, in a simple and elegant manner. But I don't know why this plug-in does not have a double-click event.
After multiple tests, use $ ('# tree '). dblclick (function () {}) and method $ ('# tree '). on ('dblclick', function () {}) does not work! Think twice about it. Finally, the rescue team solved the problem, but it seemed not very elegant, but it was still possible to deliver the problem.
The bootstrap-treeview built-in events "nodeSelected" and "nodeUnselected" are used in this solution ". double-click on the treeview node will trigger the selected event and cancel the selected event. Calculating the time interval between the two events can simulate the double-click event effect. The interval between double-click events and clicking the left mouse button each time. manual operation is 300 milliseconds.
The Code is as follows:

      
         
         

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.