josdejong / josdejong/jsoneditor

When JSONEditor.set(json) can the tree stay expanded and last node selected ?

Open
#705 7 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
JavaScript
Stars
12.3k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

Have a question.

Is the way to keep state on editor (mainly expanded and node selected still selected) after passing data with JSONEditor.set(json) ??

I know that there is JSONEditor.update(json) - but the problem is for arrays - when you try to update array with 'holes' it's not removing this items from editor.

example
[a,b,c,d] we updating [x,y, ,q] - we get [x,y,c,q]

[a,b,c,d] we updating [x,y,undefined,q] - we get [x,y,c,q]

[a,b,c,d] we updating [x,y,null,q] - we get error

Any way of getting this:
[a,b,c,d] we updating [x,y, ,q] - we want to get [x,y, ,q]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.