Fixed csv submission javascript
This commit is contained in:
parent
59526aee24
commit
ef951cbb91
@ -1,5 +1,5 @@
|
||||
function collectEditedData() {
|
||||
const rows = document.querySelectorAll('tbody tr');
|
||||
function collectEditedData(event) {
|
||||
const rows = document.querySelectorAll('.table-new-assets tbody tr');
|
||||
const assets = [];
|
||||
|
||||
rows.forEach(row => {
|
||||
@ -19,4 +19,7 @@ function collectEditedData() {
|
||||
input.name = 'assets';
|
||||
input.value = JSON.stringify(assets);
|
||||
document.querySelector('form').appendChild(input);
|
||||
|
||||
event.target.submit(); // Submit the form after attaching data
|
||||
return true;
|
||||
}
|
@ -12,7 +12,7 @@
|
||||
<!-- Display CSV data in a table -->
|
||||
{% if new_assets %}
|
||||
<p>New assets:</p>
|
||||
<table border="1">
|
||||
<table border="1" class="table-new-assets">
|
||||
<thead>
|
||||
<tr>
|
||||
{% for attrib, config in item_attributes.items() %}
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
{% if existing %}
|
||||
<p>These assets are already in the database:</p>
|
||||
<table border="1">
|
||||
<table border="1" class="table-existing-assets">
|
||||
<thead>
|
||||
<tr>
|
||||
{% for attrib, config in item_attributes.items() %}
|
||||
|
Loading…
Reference in New Issue
Block a user