Get full data in renderer

Is there a way to get complete current data state in renderer? need it to tweak data based on conditions in other field based on data entered in one field

we are using vue-vanilla

Hi @rohan.thakare,

You can inject the full managed state of JSON Forms by the name jsonforms. So for example in the composition API you can use

const jsonforms = inject<JsonFormsSubStates>('jsonforms');
const data = jsonforms.core.data

Note that you should never directly modify the data here.

Thanks Stefan for your response, yeah I used the same when I debug jsonforms core, as per your note that we should not modify data here directly, so could you please suggest what will be the right approach to tweak data in renderer.

Hi @rohan.thakare,

If you have the handleChange of JSON Forms available (because you’re using some already existing binding) then you can just hand over a different path, e.g.

this.handleChange('path.to.data.to.change.starting.from.data.root', newValue)

If not then you could also the raw dispatching, e.g.

import { Actions } from '@jsonforms/core';

const dispatch = inject('dispatch');
dispatch(Actions.update(path, () => newValue));