IT small meat Widgets Tree single-choice, multiple-choice, related callback function, obtain the selected node function, widgets callback function

Source: Internet
Author: User

IT small meat Widgets Tree single-choice, multiple-choice, related callback function, obtain the selected node function, widgets callback function

Writing a tree control is not as easy as you think. Today I spent more than an hour, IT adds single-choice, multi-choice, pre-selection, and post-selection callback functions for the IT fresh meat Widgets Tree control to obtain the selected node functions. Efforts will be made to improve the tree control later.

 

1. Set the options during initialization{select:true}Enable single choice and set the options during initialization{select:{type:'multiple'} Enable multiple choice

The example code is as follows:

 

The running effect is as follows:

 

2. added the onBeforeSelect callback function to implement custom selection. If this function returns false, the default selection behavior will be interrupted.

The example code is as follows:

The running effect is as follows:

The "Ningbo" node is unavailable.

 

3. added the onAfterSelect callback function. The Listener selects the end event. This function is called whether a node is selected or a node is selected.

4. added the function of calling tree. itxxr_tree ('getselected') to obtain the selected node.

 

The example code is as follows:

The running result is as follows:

 

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.