We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 63c0600 + fe9e23a commit 52d2bd6Copy full SHA for 52d2bd6
1 file changed
options/detail-view.html
@@ -36,9 +36,20 @@
36
<script>
37
window.detailFormatter = (index, row) => {
38
const html = []
39
+ const columns = $('#table').bootstrapTable('getOptions').columns
40
+ const getTitle = key => {
41
+ if (!Array.isArray(columns) || columns.length === 0) {
42
+ return key
43
+ }
44
+
45
+ const flatColumns = columns.flatMap(row => Array.isArray(row) ? row : [])
46
+ const column = flatColumns.find(col => col && col.field === key)
47
48
+ return column && column.title ? column.title : key
49
50
51
for (const [key, value] of Object.entries(row)) {
- html.push(`<p><b>${key}:</b> ${value}</p>`)
52
+ html.push(`<p><b>${getTitle(key)}:</b> ${value}</p>`)
53
}
54
return html.join('')
55
0 commit comments