Skip to content

Commit

Permalink
Merge pull request #6400 from utilmind/develop
Browse files Browse the repository at this point in the history
Fix #6399, HTML-formatted editable fields, issue #6399
  • Loading branch information
UtechtDustin authored Jun 8, 2023
2 parents 7ba6c41 + 8df0f9c commit b24b5fd
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/extensions/editable/bootstrap-table-editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ $.BootstrapTable = class extends $.BootstrapTable {
}

const editableOptions = {}
const editableDataMarkup = []
const editableDataPrefix = 'editable-'
const processDataOptions = (key, value) => {
// Replace camel case with dashes.
Expand Down Expand Up @@ -77,26 +76,26 @@ $.BootstrapTable = class extends $.BootstrapTable {

$.each(column, processDataOptions)

$.each(editableOptions, (key, value) => {
editableDataMarkup.push(` ${key}="${value}"`)
})

let noEditFormatter = false
const editableOpts = Utils.calculateObjectValue(column,
column.editable, [index, row], {})
const noEditFormatter = editableOpts.hasOwnProperty('noEditFormatter') &&
editableOpts.noEditFormatter(value, row, index, field)

if (editableOpts.hasOwnProperty('noEditFormatter')) {
noEditFormatter = editableOpts.noEditFormatter(value, row, index, field)
if (noEditFormatter) {
return noEditFormatter
}

if (noEditFormatter === false) {
return `<a href="javascript:void(0)"
data-name="${column.field}"
data-pk="${row[this.options.idField]}"
data-value="${result}"
${editableDataMarkup.join('')}></a>`
}
return noEditFormatter
let editableDataMarkup = ''

$.each(editableOptions, (key, value) => {
editableDataMarkup += ` ${key}="${value}"`
})

return `<a href="javascript:void(0)"
data-name="${column.field}"
data-pk="${row[this.options.idField]}"
data-value="${value || ''}"
${editableDataMarkup}>${result}</a>` // expand all data-editable-XXX
}
})
}
Expand Down

0 comments on commit b24b5fd

Please sign in to comment.