Closed sagIoTPower closed 1 year ago
Hi,
I explored how this could be achieved and ran a local test.
First I exported
export function updateSelection(selection: ....)
much like
export function scrollTo(path: Path)
in the following svelte scripts:
src/lib/components/modes/tablemode/TableMode.svelte
src/lib/components/modes/treemode/TreeMode.svelte
Other files I had to touch were:
src/lib/components/modes/JSONEditorRoot.svelte
src/lib/components/JSONEditor.svelte
Finally I could set the selection.
Would it be possible to expose in JSONEditor?
function updateSelection(selection: ....)
Thanks
Thanks @sagIoTPower for your PR!
This will address #163. Do you have any thoughts on the open discussion there, in https://github.com/josdejong/svelte-jsoneditor/issues/163#issuecomment-1277397051?
I'll close this issue now in favor of #163 to keep the discussion focused.
Could you provide a sample how to set the selection to a specific path? I don't see a way/method to change the selected node programmatically.