Skip to content
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

Ext-Persist problem #217

Closed
mafar opened this issue May 2, 2014 · 3 comments
Closed

Ext-Persist problem #217

mafar opened this issue May 2, 2014 · 3 comments

Comments

@mafar
Copy link

mafar commented May 2, 2014

Hello, I am experiencing problems using persist plugin.
I am using table ext along-with persist-ext. But when I reload my page, Tree doesnt recover last selected node. Is there a problem with my Json ?

Note: To explain my issue, I am using JSFIDDLE, so If you select any node and press RUN in jsfiddle, it should recover last active node by selecting it.

1st JSFIDDLE:
This is not working for some reason and doesn't recover my last selected node when i press run button in fiddle.
http://jsfiddle.net/bababalcksheep/PMqnB/26/

2nd JSFIDDLE:
This some how works.
http://jsfiddle.net/bababalcksheep/PMqnB/25/

I cant figure what`s wrong in my 1st JSFIDDLE: which is my real example.

@mar10 mar10 added this to the 2.1 Backlog milestone May 3, 2014
@mar10
Copy link
Owner

mar10 commented May 4, 2014

I couldn't reproduce this (both fiddles don't seem to wirk here).
Please post some code that helps to reproduce this (see /test/triage for templates)

@mafar
Copy link
Author

mafar commented May 5, 2014

Ok, I i have been looking into this and found the problem.
Persist ext is expecting string as value of key. SO
{"key": "2", "title": "abc" } will work
but {"key": 2 , "title": "abc" } wont because 2 is int not string.

However most of the time DB`s have unique keys and on server-side keys are returned as int instead of strings as they are unique.

According to http://en.wikipedia.org/wiki/JSON
int/Boolean are not stringified as standard practice.

I added this example at /test/triage
https://github.com/djangosdk/fancytree/blob/patch-2/test/triage/test-issue-table-001-extpersist.html

@mar10 mar10 closed this as completed in 0f727d1 May 5, 2014
@mafar
Copy link
Author

mafar commented May 6, 2014

Hello,
This is still not working for me.i will see if i can produce it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants