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

Abstract key, title and children paths #41

Closed
guilhermeaiolfi opened this issue Jul 15, 2013 · 7 comments
Closed

Abstract key, title and children paths #41

guilhermeaiolfi opened this issue Jul 15, 2013 · 7 comments
Labels
Milestone

Comments

@guilhermeaiolfi
Copy link

Hi,

it could be useful for people that can't change what it comes from the server and want to avoid a extra step to create the data array.

I could try to do that if there is any interest.

e.g.

{ 
  keyPath: "id",
  titlePath: "label",
  childrenPath: "nodes"
}
@mar10
Copy link
Owner

mar10 commented Jul 27, 2013

nodeLoadChildren call the postProcess callback, which allows to modify the ajax response before applying it.
This is a very generic approach. Do you see any problems with this, or have suggestions to improve this?

@guilhermeaiolfi
Copy link
Author

No, postProcessseems good enough. Thanks.

@mar10 mar10 added this to the 2.0.0beta milestone May 11, 2014
@guilhermeaiolfi
Copy link
Author

But it's not called for root nodes. So it's very inconsistent and doesn't solve the problem. Any other idea?

@guilhermeaiolfi
Copy link
Author

I'll be reopening this because I read all the docs and couldn't find a way of doing what I think should be pretty trivial.

@mar10
Copy link
Owner

mar10 commented Sep 26, 2014

But it's not called for root nodes. So it's very inconsistent and doesn't solve the problem.

postProcess is called for all ajax responses, including tree init (otherwise please submit a bug).

I read all the docs and couldn't find a way...

what is missing here?:
https://github.com/mar10/fancytree/wiki/TutorialLoadData#howto-handle-custom-data-formats

@guilhermeaiolfi
Copy link
Author

The postProcess is well documented. But the ability to change the key path is not. But only because it didn't work as expected.

See this JSBin: http://jsbin.com/vadecusifunu/1/edit

@mar10
Copy link
Owner

mar10 commented Nov 14, 2014

Please give more details and re-open if you are still facing a problem.

@mar10 mar10 closed this as completed Nov 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants