当前位置:网站首页>jsPlumb. Deleteeveryconnection is not a function & jsplumb clear canvas jsplumb delete all nodes and all connections
jsPlumb. Deleteeveryconnection is not a function & jsplumb clear canvas jsplumb delete all nodes and all connections
2022-06-30 14:24:00 【mizuhokaga】
0. problem
Using jsPlumb.deleteEveryConnection Delete all connection errors jsPlumb.deleteEveryConnection is not a function!
1. solve
jsPlumb.js The version is Community Edition Community Edition 1.7.6.
my jsPlumb yes cdn Introduced , Go directly to the web page to view js Source file .
Find out deleteEveryConnection Method really can't find , Then I turned it over , Found... In the file detachEveryConnection()!
Use
jsPlumb.detachEveryConnection();
after The error report disappears and the problem is solved
2.jsPlumb Delete all nodes and wires on the canvas
There are... On the canvas node 、 Lines and endpoints . Where the line and the endpoint are jsplumb Maintenance of , Nodes need to be maintained by ourselves .
jsPlumb There are only
- Delete the endpoints of all nodes detachEveryConnection
- Delete all connections deleteEveryEndpoint
These two methods , For node deletion, I only found remove(id) Method
therefore JsPlumb The idea of clearing the canvas is as follows :
Find your own way to clear the nodes ( I use remove Method ), then jsplumb The generated endpoints and wires are generated by jsplumb The two above api Clean up .
tableID=new Array();
function clear(){
clearAllNode();
jsPlumb.detachEveryConnection();
jsPlumb.deleteEveryEndpoint ()
}
function clearAllNode(){
if(tableID.length!==0){
tableID.forEach(id=>{
jsPlumb.remove(id)
})
}
}
tableID Is the storage node id Array of , You need to store the data in the node in advance id.
Traverse when deleting tableID, According to the node id remove Drop all nodes , Then clear the line and the endpoint .
边栏推荐
- 【科研数据处理】[实践]类别变量频数分析图表、数值变量分布图表与正态性检验(包含对数正态)
- [buuctf] [actf2020 freshman competition]exec1
- org.json.JSONObject对象转json,json新增元素,根据json的key获取值。以及list对象格式字符串转jsonArray
- 【Kubernetes系列】K8s设置MySQL8大小写不敏感
- The programming competition is coming! B station surrounding, senior members and other good gifts to you!
- org. json. The jsonobject object is converted to JSON, and JSON adds new elements. The value is obtained according to the JSON key. And list object format string to jsonarray
- @ResponseBody的作用
- Comprehensively analyze the basic features and summary of free and paid SSH tools
- Complete TCP forwarding server (kernel linked list + mutex)
- The first three passes of sqli Labs
猜你喜欢

Introduction to reverse commissioning - VA and RVA conversion in PE 04/07

DiceCTF - knock-knock

More than 20 years after Hong Kong's return, Tupu digital twin Hong Kong Zhuhai Macao Bridge has shocked
![[scientific research data processing] [basic] category variable frequency analysis chart, numerical variable distribution chart and normality test (including lognormal)](/img/70/8bf226964118efb324ca4d339df654.png)
[scientific research data processing] [basic] category variable frequency analysis chart, numerical variable distribution chart and normality test (including lognormal)

Getting started with shell Basics

Using docker to manage MySQL services under Windows

Detailed explanation of the first three passes of upload Labs

Configuration of headquarters dual computer hot standby and branch infrastructure for firewall Foundation

I love network security for new recruitment assessment

About the problems encountered when using the timer class to stop with a button (why does the QPushButton (for the first time) need to be clicked twice to respond?)
随机推荐
QQ 居然被盗了?原因在这......
[geek challenge 2019] PHP problem solving record
org.json.JSONObject对象转json,json新增元素,根据json的key获取值。以及list对象格式字符串转jsonArray
About the problems encountered when using the timer class to stop with a button (why does the QPushButton (for the first time) need to be clicked twice to respond?)
Getting started with shell Basics
LeetCode_ Stack_ Medium_ 227. basic calculator II (without brackets)
表格储存中sql查询的时候,查询结果增加主键报错,查询结果超过10w行。需要对主键增加上多元索引吗?
[scientific research data processing] [basic] category variable frequency analysis chart, numerical variable distribution chart and normality test (including lognormal)
Service online governance
Solve the error in my QT_ thread_ global_ End(): 3 threads didn't exit
Laravel configures passport and returns token using JWT
Why does the folder appear open in another program
Att & CK red team evaluation field (I)
Summary of use of laravel DCAT admin
编程实战赛来啦!B站周边、高级会员等好礼送你啦!
DefCamp Capture the Flag (D-CTF) 2021-22 web
Deep understanding Net (2) kernel mode 3 Kernel mode construct mutex
Configuration of headquarters dual computer hot standby and branch infrastructure for firewall Foundation
Upgrade composer self update
【Kubernetes系列】K8s设置MySQL8大小写不敏感