📜  jQWidgets jqxTree dragEnd 属性(1)

📅  最后修改于: 2023-12-03 15:32:20.642000             🧑  作者: Mango

jQWidgets jqxTree dragEnd 属性

The dragEnd event is a property of the jQWidgets jqxTree widget. It is triggered when drag and drop operation is completed.

Syntax
$("#jqxTree").on("dragEnd", function (event) {
    // code to handle dragEnd event
});
Parameters

The event parameter contains information about the event, such as the source tree item and the target tree item.

Example
// create jqxTree widget
$("#jqxTree").jqxTree({
    source: [{ label: "item 1" }, { label: "item 2" }, { label: "item 3" }]
});
// handle dragEnd event
$("#jqxTree").on("dragEnd", function (event) {
    var sourceItem = event.args.element;
    var targetItem = event.args.targetElement;
    console.log("dragEnd: source item = " + sourceItem.firstChild.innerText + 
        ", target item = " + targetItem.firstChild.innerText);
});

In this example, we create a jqxTree widget with three tree items. We then handle the dragEnd event by logging the source item and the target item to the console.

Remarks

The dragEnd event is useful for tracking the completion of drag and drop operations in the jqxTree widget. It can be used to perform actions such as updating the tree data, refreshing the tree, or displaying a message to the user.

Conclusion

The dragEnd event is an essential property of the jQWidgets jqxTree widget. It provides a way to handle drag and drop operations in a tree structure and can be used to trigger various actions.