-
-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Specify persistence feature #11
Comments
Closing RFC issues, because they should not appear as Open Issue. This thread is still open for discussion! |
Hi, pls tell me i can use persist option with link ? |
Regarding "When node is re-activated, should the activate event be fired again?" from SpecPersistence, any tweaks I can make locally so the activate event is not fired? |
Hi! |
Can I restore the new node rather than status that i add so that I can see it after the page refreshing? |
@244958898 sorry, but I do not understand your question |
@mar10
Reference: DEFAULT OPTIONS layout.jquery stateManagement: {
enabled: false,
// true = enable state-management, even if not using cookies
// needed when autoSave or autoLoad are functions not boolean
autoSave: true,
// autoSave:boolean ==> Save state using cookie
// autoSave:function ==> use your own method to save it
autoLoad: true,
// autoLoad:boolean ==> Load state using cookie at init
// autoLoad:function ==> use your own method to load state options at init and return it
} PRACTICAL EXAMPLE layout.jquery electron nconf // Save and Load state from file instead of cookies-built-in-method
// in node.js/electron environment using library nconf
stateManagement: {
enabled: true,
autoLoad: function () {
// load instance_state at init
// get instance_state from anywhere like a file (if in electron),cookie,store.js whatever
// get from local file using nconf/node.js
return nconf.get('layout-state');
},
autoSave: function (instance, instance_state, instance_options) {
// save instance_state whereever you want
// save to local file using nconf/node.js
nconf.set('layout-state', instance_state).save();
}
} Question:
|
By looking at source code in if (typeof Cookies === "function") {
cookieSetter = Cookies.set;
cookieGetter = Cookies.get;
cookieRemover = Cookies.remove;
} else {
cookieSetter = cookieGetter = $.cookie;
cookieRemover = $.removeCookie;
} It would be nice if it had object support so that I could use it like // object support
if (typeof Cookies === "function" || "object") {
cookieSetter = Cookies.set;
cookieGetter = Cookies.get;
cookieRemover = Cookies.remove;
} else {
cookieSetter = cookieGetter = $.cookie;
cookieRemover = $.removeCookie;
} Usage:
|
@mar10 |
@mafar Good suggestion. |
Discuss and finalize this RFC:
https://github.com/mar10/fancytree/wiki/SpecPersistence
The text was updated successfully, but these errors were encountered: