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

Method _createAddRowButton

src/editors/table.js:498–513  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

496 }
497
498 _createAddRowButton () {
499 const button = this.getButton(this.getItemTitle(), 'add', 'button_add_row_title', [this.getItemTitle()])
500 button.classList.add('json-editor-btntype-add')
501 button.addEventListener('click', (e) => {
502 e.preventDefault()
503 e.stopPropagation()
504
505 const editor = this.addRow()
506 this.refreshValue()
507 this.refreshRowButtons()
508 this.onChange(true)
509 this.jsoneditor.trigger('addRow', editor)
510 })
511 this.controls.appendChild(button)
512 return button
513 }
514
515 _createDeleteLastRowButton () {
516 const button = this.getButton('button_delete_last', 'subtract', 'button_delete_last_title', [this.getItemTitle()])

Callers 1

addControlsMethod · 0.95

Calls 8

getItemTitleMethod · 0.95
addRowMethod · 0.95
refreshValueMethod · 0.95
refreshRowButtonsMethod · 0.95
addMethod · 0.80
triggerMethod · 0.80
getButtonMethod · 0.45
onChangeMethod · 0.45

Tested by

no test coverage detected