Permanent copy and paste for jstree nodes

By default, setting up copy & paste using jstree as described in the documentation is quite simple and works well, but only within the context of the JavaScript variable context of the loaded page.

In particular, if I select a copy and then paste it, this will work. However, if I select a copy, and then reload the page, the insert will not work, since the copy data will be lost.

How can I do this job? I think that something will need to be saved and extracted from the cookie. Where can i find this? Also, is there an existing option in the plugin for this use case?

+3
source share
2 answers

Depending on your audience, I would try to implement copy / paste through html5 local storage. For some simple copying text, etc. Its pretty easy to implement.

Html 5 local storage is just a key pair: a value that is stored in the local memory of the users browser. Therefore, it will be supported by restarting the web browser. Even if it can be saved if they accidentally close from the browser!

I think with a little javascript, and if you use the jQuery library, it shouldn't be too hard to implement. You could even add the added benefit of multiple copies, since you could just have a few key: value pairs.

, , , -, , :

http://paperkilledrock.com/2010/05/html5-localstorage-part-one/

+1
0

All Articles