当前位置:网站首页>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 .
边栏推荐
- XSS challenge (1-5) more detailed answers
- 【BUUCTF】 Have Fun
- remote: Support for password authentication was removed on August 13, 2021. Please use a personal ac
- PHP reverses scenarios based on code and skillfully uses debug_ backtrace()
- MySQL back to table query optimization
- 想請教一下,我在佛山,到哪裏開戶比較好?手機開戶是安全麼?
- Go language func function
- How to execute a query SQL
- "As a service", the inevitable choice of enterprise digital transformation
- Why is the resolution of the image generated by PHP GD library 96? How to change it to 72
猜你喜欢
Solve the error in my QT_ thread_ global_ End(): 3 threads didn't exit
Lifting scanning tool
QQ 居然被盗了?原因在这......
Optimization of unit test efficiency: why test programs? What are the benefits of testing?
go channel && select
Why does the folder appear open in another program
I love network security for new recruitment assessment
ThinkPHP show method parameter controllable command execution
Mysql database foundation: stored procedures and functions
Pytoch viewing model parameter quantity and calculation quantity
随机推荐
“即服务”,企业数字化转型的必然选择
Laravel upload error
KnightCTF WEB
The first dark spring cup dnuictf
Summary of FTP network protocol learning
PHP reverses scenarios based on code and skillfully uses debug_ backtrace()
Chapter 13 signal (III) - example demonstration
ThinkPHP v3.2 comment annotation injection write shell
MFQE 2.0: A New Approach for Multi-FrameQuality Enhancement on Compressed Video
Apache Doris comparison optimization Encyclopedia
org.json.JSONObject对象转json,json新增元素,根据json的key获取值。以及list对象格式字符串转jsonArray
Prometheus 2.29.0 new features
Problems in QT creator (additional unknown and error lines are listed in the debug output window)
Logiciel de récupération de données easyrecovery15 téléchargement
I want to ask how to open an account at China Merchants Securities? Is it safe to open a stock account through the link
Summary of use of laravel DCAT admin
我想问一下招商证券怎么开户?通过链接办理股票开户安全吗
Implementation of forwarding server using IO multiplexing
重磅:国产IDE发布,由阿里研发,完全开源!
PHP excel export function encapsulation (based on phpexcel class)