not able to implement readonly or not editable functionaliy.
See original GitHub issueWhen i try to implement onEditable getting the below error ERROR TypeError: this.editorOptions.onEditable is not a function at JsonEditorComponent
- json-editor version: 1.10.5
Expected behavior
Actual behavior
Steps to reproduce the behavior
Implement the onEditable in Angular
would like know how to implement the below part
{function} onEditable({ path, field, value })
Set a callback function to determine whether individual nodes are editable or read-only. Only applicable when option mode is tree, text, or code.
In case of mode tree, the callback is invoked as editable(node), where the first parameter is an object:
{
field: string,
value: string,
path: string[]
}
The function must either return a boolean value to set both the nodes field and value editable or read-only, or return an object {field: boolean, value: boolean} to set set the read-only attribute for field and value individually.
In modes text and code, the callback is invoked as editable(node) where node is an empty object (no field, value, or path). In that case the function can return false to make the text or code editor completely read-only.
with an example will be really hepful
@josdejong expecting a reply .
Thanks in advance
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
HTML attribute: readonly - HTML: HyperText Markup Language
The Boolean readonly attribute, when present, makes the element not mutable, meaning the user can not edit the control.
Read more >React - Why is input field still readonly (i.e. not editable) even ...
The input field remains readonly and onChange won't fire despite my varied and increasingly desperate attempts to coax it into behaving like the...
Read more >HTML5 Forms: Readonly Type Attribute - Wufoo
The readonly attribute makes a form control non-editable (or “read only”). A read-only field can't be modified, but, unlike disabled , you can...
Read more >Make a document read only - Microsoft Support
Make a document read-only by restricting editing and formatting. ... a read-only file means that the document can be read or copied but...
Read more >HTML input readonly Attribute - W3Schools
The readonly attribute is a boolean attribute. When present, it specifies that an input field is read-only. A read-only input field cannot be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If I good understand your need it’s possible by using the
disable
method.Please check this link for more details https://github.com/json-editor/json-editor#enable-and-disable-the-editor.
ping @amk0