File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ export default class ReactJSONForm extends React.Component {
5252 errorMap : this . props . errorMap || { }
5353 } ;
5454
55+ if ( this . props . readonly )
56+ args . schema . readOnly = true ;
57+
5558 if ( type === 'array' )
5659 return getArrayFormRow ( args ) ;
5760 else if ( type === 'object' )
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export function FormInstance(config) {
1414 this . errorMap = config . errorMap ;
1515 this . fileHandler = config . fileHandler ;
1616 this . fileHandlerArgs = config . fileHandlerArgs || { } ;
17+ this . readonly = config . readonly || false ;
1718
1819 this . eventListeners = null ;
1920
@@ -59,6 +60,7 @@ export function FormInstance(config) {
5960 fileHandler = { this . fileHandler }
6061 fileHandlerArgs = { this . fileHandlerArgs }
6162 onChange = { this . onChange }
63+ readonly = { this . readonly }
6264 /> ,
6365 document . getElementById ( this . containerId )
6466 ) ;
@@ -175,6 +177,7 @@ export class FormContainer extends React.Component {
175177 fileHandler = { this . props . fileHandler }
176178 fileHandlerArgs = { this . props . fileHandlerArgs }
177179 errorMap = { this . props . errorMap }
180+ readonly = { this . props . readonly }
178181 />
179182 ) ;
180183 }
You can’t perform that action at this time.
0 commit comments