MCPcopy Index your code
hub / github.com/json-editor/json-editor / onChange

Method onChange

src/core.js:237–265  ·  view source on GitHub ↗
(eventData)

Source from the content-addressed store, hash-verified

235 }
236
237 onChange (eventData) {
238 if (!this.ready) return
239
240 if (eventData) {
241 this.trigger(eventData.event, eventData.data)
242 }
243
244 if (this.firing_change) return
245 this.firing_change = true
246
247 window.requestAnimationFrame(() => {
248 this.firing_change = false
249 if (!this.ready) return
250
251 /* Validate and cache results */
252 this.validation_results = this.validator.validate(this.root.getValue())
253
254 if (this.options.show_errors !== 'never') {
255 this.root.showValidationErrors(this.validation_results)
256 } else {
257 this.root.showValidationErrors([])
258 }
259
260 /* Fire change event */
261 this.trigger('change')
262 })
263
264 return this
265 }
266
267 compileTemplate (template, name = JSONEditor.defaults.template) {
268 let engine

Callers 15

setOptionMethod · 0.95
setValueMethod · 0.45
_createDeleteButtonMethod · 0.45
_createCopyButtonMethod · 0.45
_createMoveUpButtonMethod · 0.45
_createMoveDownButtonMethod · 0.45
_supportDragDropMethod · 0.45
_createAddRowButtonMethod · 0.45
buildMethod · 0.45
refreshPreviewMethod · 0.45

Calls 4

triggerMethod · 0.95
validateMethod · 0.45
getValueMethod · 0.45
showValidationErrorsMethod · 0.45

Tested by

no test coverage detected