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

Customize object names #339

Closed
chromey opened this issue Nov 22, 2016 · 6 comments
Closed

Customize object names #339

chromey opened this issue Nov 22, 2016 · 6 comments

Comments

@chromey
Copy link

chromey commented Nov 22, 2016

I'd like to have the possibility to customize what is rendered as the name of a collapsed object. For example, if I have an array with lots of objects with an identifying field such as 'id' or 'name', I'd rather display that instead of the default field count.

I have created a PR that accomplishes this with a callback "onObjectName" that can be passed as an additional option. The callback gets handed the object's path and child nodes. Returning null from the callback falls back to displaying the field count.

#338

Awesome project btw, keep going!

@josdejong
Copy link
Owner

Nice idea, I like it. this way you can give a more informative summary of what's in an object.

Your PR looks neat. A few remarks:

  • Would it be interesting/consistent/useful to allow setting the name of Arrays too?
  • Can you describe the new feature in docs/api.md too?

@josdejong
Copy link
Owner

@chromey any news on this?

@chromey
Copy link
Author

chromey commented Feb 21, 2017

I realized that my implementation has an issue with the editor's lifecycle. That is, the object's name would not update when its properties change. Probably easy to fix, but it disappeared in my backlog.
Will look into it as soon as I find a minute.

@josdejong
Copy link
Owner

josdejong commented Feb 21, 2017

Thanks for your feedback. Would be nice if you could find a fix for that. If it becomes too complicated, it may be interesting to see whether this will be easier to implement in the upcoming v6 next which is a complete rewrite (see #337).

@bnanchen
Copy link
Contributor

bnanchen commented Dec 20, 2018

Hi,
Any news about this issue? Has it been finalized? Will it be implemented in v6?
I've only found a PR (#338) with the last commit in November 2016.

Thank you for your help :)

@bnanchen
Copy link
Contributor

I've opened PR #617 concerning this issue.

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

No branches or pull requests

3 participants