As does not accept drag and drop unaccept and custom drag and drop indicator dropindicatorskin

Source: Internet
Author: User

In as, the following options are supported: dragmanager. acceptdragdrop (uicomponent); In the dragenter event.

To selectively accept drag and drop based on the conditions:

If () // accept

Dragmanager. acceptdragdrop (uicomponent );

Else // not accepted

Dragmanager. acceptdragdrop (event. draginitiator );

 

About the custom dropindicatorskin:

Package components <br/>{</P> <p> Import flash. display. graphics; </P> <p> Import MX. controls. alert; <br/> Import MX. skins. programmaticskin; </P> <p>/** <br/> * the skin for the drop indicator of a list-based control. <br/> */<br/> public class listdropindicator extends programmaticskin <br/>{</P> <p> // optional <br/> // <br/> // constructor <br/> // operator </P> <p>/** <br/> * constructor. <br/> */<br/> Public Function listdropindicator () <br/> {<br/> super (); <br/>}</P> <p> // specify <br/> // overridden methods <br/> // <br/>/ /configure </P> <p>/** <br/> * @ private <br/> */<br/> override protected function updatedisplaylist (W: number, H: Number): void <br/>{< br/> super. updatedisplaylist (W, H); </P> <p> var G: Graphics = graphics; </P> <p> G. clear (); <br/> G. beginfill (0xa1bde2, 0.5); <br/> G. drawrect (-50,-1, W + 50, 23); <br/>}< br/>}

 <Mx: Tree x = "774" Y = "343" id = "Tree" dataprovider = "{employees. type} "labelfield =" @ name "width =" 280 "Height =" 167 "<br/> dragenabled =" true "dropindicatorskin =" components. listdropindicator "dropenabled =" true "<br/> dragenter =" tree_dragenterhandler (event) "dragover =" tree_dragoverhandler (event) "<br/> dragcomplete =" tree_dragcompletehandler (Event) "dragexit =" tree_dragexithandler (event) "> <br/>/** <br/> * As shown in If dropenabled = true is set for the tree, then dragmanager. acceptdragdrop (tree) is only available in event. preventdefault () takes effect <br/> * tree. showdropfeedback (event) displays the drag and drop indicator. It can be used together with dragmanager. showfeedback (dragmanager. Link) <br/> * showdropfeedback (event) is a horizontal line by default. <Br/> **/<br/> protected function tree_dragenterhandler (Event: dragevent): void <br/>{< br/> event. preventdefault (); <br/> dragmanager. acceptdragdrop (tree); <br/> tree. showdropfeedback (event); <br/>}< br/> protected function tree_dragoverhandler (Event: dragevent): void <br/>{< br/> event. preventdefault (); <br/> tree. showdropfeedback (event); <br/>}< br/> protected function tree_dragcompletehandler (Event: dragevent): void <br/>{< br/> event. preventdefault (); <br/> tree. hidedropfeedback (event); <br/>}< br/>/** <br/> * Similarly, if you set dropenabled = true, showdropfeedback (Event) it must be in the event. preventdefault () takes effect <br/> **/<br/> protected function tree_dragexithandler (Event: dragevent): void <br/>{< br/> tree. hidedropfeedback (event); <br/>}

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.