mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add button to display original row data
This commit is contained in:
parent
383835aa89
commit
d38a8adf4c
@ -78,7 +78,7 @@ function constructBomUploadTable(data, options={}) {
|
||||
|
||||
var buttons = `<div class='btn-group float-right' role='group'>`;
|
||||
|
||||
// buttons += makeIconButton('fa-file-alt', 'button-row-data', idx, '{% trans "Display row data" %}');
|
||||
buttons += makeIconButton('fa-info-circle', 'button-row-data', idx, '{% trans "Display row data" %}');
|
||||
buttons += makeIconButton('fa-times icon-red', 'button-row-remove', idx, '{% trans "Remove row" %}');
|
||||
|
||||
buttons += `</div>`;
|
||||
@ -129,6 +129,29 @@ function constructBomUploadTable(data, options={}) {
|
||||
$(`#button-row-remove-${idx}`).click(function() {
|
||||
$(`#items_${idx}`).remove();
|
||||
});
|
||||
|
||||
// Add callback for "show data" button
|
||||
$(`#button-row-data-${idx}`).click(function() {
|
||||
|
||||
var modal = createNewModal({
|
||||
title: '{% trans "Row Data" %}',
|
||||
cancelText: '{% trans "Close" %}',
|
||||
hideSubmitButton: true
|
||||
});
|
||||
|
||||
// Prettify the original import data
|
||||
var pretty = JSON.stringify(row, undefined, 4);
|
||||
|
||||
var html = `
|
||||
<div class='alert alert-block'>
|
||||
<pre><code>${pretty}</code></pre>
|
||||
</div>`;
|
||||
|
||||
modalSetContent(modal, html);
|
||||
|
||||
$(modal).modal('show');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// Request API endpoint options
|
||||
|
@ -1953,7 +1953,13 @@ function constructField(name, parameters, options) {
|
||||
html += parameters.before;
|
||||
}
|
||||
|
||||
html += `<div id='div_id_${field_name}' class='${form_classes}'>`;
|
||||
var hover_title = '';
|
||||
|
||||
if (parameters.help_text) {
|
||||
hover_title = ` title='${parameters.help_text}'`;
|
||||
}
|
||||
|
||||
html += `<div id='div_id_${field_name}' class='${form_classes}' ${hover_title}>`;
|
||||
|
||||
// Add a label
|
||||
if (!options.hideLabels) {
|
||||
|
Loading…
Reference in New Issue
Block a user