JSON Manager with Do Action patches
Manage dataset and apply JSON Patch with DoAction plugin.
The value is:
Source code
<!-- JSON Manager defining the dataset name -->
<div id="myIdForHelloWorld" data-wb-jsonmanager='{"name": "helloworld"}'></div>
<!-- Display the value -->
<p>The value is:</p>
<div class="mrgn-bttm-lg">
<output data-json-replace="#[helloworld]/yep">Not set yet</output>
</div>
<!-- Action button -->
<button class="btn btn-default" type="button" data-wb-doaction='{
"action": "patch",
"source": "#myIdForHelloWorld",
"patches":
{
"op": "add",
"path": "/yep",
"value": "a test"
}
}'>Set value to: <code>a test</code></button>
<button class="btn btn-default" type="button" data-wb-doaction='{
"action": "patch",
"source": "#myIdForHelloWorld",
"patches":
{
"op": "add",
"path": "/yep",
"value": "a second test"
}
}'>Set value to: <code>a second test</code></button>
<button class="btn btn-default" type="button" data-wb-doaction='{
"action": "patch",
"source": "#myIdForHelloWorld",
"patches":
{
"op": "add",
"path": "/yep",
"value": 123
}
}'>Set value to: <code>123</code></button>
Page details
- Date modified: