MCPcopy Create free account
hub / github.com/json-editor/json-editor / _createRemoveAllRowsButton

Method _createRemoveAllRowsButton

src/editors/array.js:812–832  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

810 }
811
812 _createRemoveAllRowsButton () {
813 const button = this.getButton('button_delete_all', 'delete', 'button_delete_all_title')
814 button.classList.add('json-editor-btntype-deleteall')
815 button.addEventListener('click', (e) => {
816 e.preventDefault()
817 e.stopPropagation()
818
819 if (!this.askConfirmation()) {
820 return false
821 }
822
823 const values = this.getValue()
824
825 this.empty(true)
826 this.setValue([])
827 this.onChange(true)
828 this.jsoneditor.trigger('deleteAllRows', values)
829 })
830 this.controls.appendChild(button)
831 return button
832 }
833
834 showValidationErrors (errors) {
835 /* Get all the errors that pertain to this editor */

Callers 1

addControlsMethod · 0.95

Calls 8

askConfirmationMethod · 0.95
emptyMethod · 0.95
setValueMethod · 0.95
addMethod · 0.80
triggerMethod · 0.80
getButtonMethod · 0.45
getValueMethod · 0.45
onChangeMethod · 0.45

Tested by

no test coverage detected