Open Confectus opened 1 week ago
The only solution I find viable is to listen to some event when instantiating the JSONEditor object.
For example, it could be something like this:
let json_editor = new JSONEditor($refs.editor, options); json_editor.set(JSON.parse(JSON.stringify(state)));
if(typeof json_editor !== 'undefined'){
json_editor = new JSONEditor($refs.editor, options);
json_editor.set(JSON.parse(JSON.stringify(state)));
} else {
let json_editor = new JSONEditor($refs.editor, options);
json_editor.set(JSON.parse(JSON.stringify(state)));
window.addEventListener('json-state-updated', function(event) {
json_editor.set(JSON.parse(JSON.stringify(event.detail.data)));
});
}
I was trying to update the editor value by using the
$set
callable in Filament. By the way, only the JSON viewer is updated.I think the project you based it on had the same problem. If you can think of any solution that could be implemented?
https://github.com/invaders-xx/filament-jsoneditor/issues/23