Extjs + ASP. NET implement tree node dragging (dragdrop)

Source: Internet
Author: User

Abstract: This article describes how to use extjs and ASP. NET to drag a node of treepanel (Drag & drop ). For example, drag a node to another parent node and insert it before/after it.

Extjs + ASP. NET implement tree node drag (dragdrop) is very simple.

First, enable the options of treepanel to allow dragdrop:

 
1: VaRTree =NewExt. Tree. treepanel ({
2:
 
3:...// Omitted here
4:
 
5:Enabledd:True,// Allow dragdrop
6:
 
7:...// Omitted here
8:
 
9:})

Define events:

1:Tree. On ("Dragdrop", Treedragdrophandler );
 
2:
3: FunctionTreedragdrophandler (T, node, DD, e ){
 
4:Alert (node. ID );// Source node ID
  5:  alert (node. parentnode. ID);  // target parent node id  
  6:  alert (node. nextsibling? Node. nextsibling. ID:  "" );  // the ID of the next node, used to drag a node before/after it is inserted to another node  
  7:  alert (node. previussibling? Node. previussibling. ID:  "" );  // ID of the previous node, used to drag a node before/after it is inserted to another node  
8: // Todo: Add operations here, such as saving the drag result to the database!
 
9:
10:}

In this way, you can drag the treepanel node (Drag & drop ). For example, drag a node to another parent node and insert it before/after it.

    • Extjs + ASP. NET implements a real progress bar to display the progress of the server's long-term operations
    • Extjs + ASP. NET Implement Asynchronous Tree node search and find next (findnext)
    • Extjs + ASP. NET implement tree node dragging (dragdrop)
    • Extjs + ASP. NET implement the drag from grid to tree (dragdrop)
    • Extjs ASP. NET Server Side implements ashx and asmx to process client requests
    • Use Yui compressor and DOS batch processing scripts to compress JavaScript and CSS
    • Optimize Javascript
    • Distinguish underfined, null, and Nan in Javascript
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.