add new func
This commit is contained in:
@@ -7,29 +7,30 @@ function getAllData(){
|
|||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
|
||||||
success: function(response){
|
success: function(response){
|
||||||
console.log(response)
|
console.log("1111")
|
||||||
let data = response;
|
let data = response;
|
||||||
$('#datatable tbody').empty();
|
var table = document.getElementById('alldatable');
|
||||||
$.each(response, function(index, item) {
|
var tbody = table.getElementsByTagName('tbody')[0];
|
||||||
$('#datatable tbody').append(
|
|
||||||
'<tr>' +
|
|
||||||
'<td>' + item.invNumber + '</td>' +
|
|
||||||
'<td>' + item.nazvanie + '</td>' +
|
|
||||||
'<td>' + item.raspologenie + '</td>' +
|
|
||||||
'<td>' + item.numberved + '</td>' +
|
|
||||||
'<td>' + item.buhnumberpp + '</td>' +
|
|
||||||
'<td>' + item.kolichestvo + '</td>' +
|
|
||||||
'<td>' + item.balancenumber + '</td>' +
|
|
||||||
'</tr>'
|
|
||||||
);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
|
// Clear existing data
|
||||||
|
tbody.innerHTML = '';
|
||||||
|
|
||||||
|
// Loop through the data and create table rows
|
||||||
|
data.forEach(function(item) {
|
||||||
|
var row = document.createElement('tr');
|
||||||
|
Object.values(item).forEach(function(value) {
|
||||||
|
var cell = document.createElement('td');
|
||||||
|
cell.textContent = value;
|
||||||
|
row.appendChild(cell);
|
||||||
|
});
|
||||||
|
tbody.appendChild(row);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
getAllData()
|
getAllData()
|
||||||
})
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="card col-md-11" >
|
<div class="card col-md-11" >
|
||||||
<table id="datable" class="datable table pagebreak" >
|
<table id="datable" class="alldatable table pagebreak" >
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">№ п/п</th>
|
<th scope="col">№ п/п</th>
|
||||||
|
|||||||
@@ -10,3 +10,4 @@
|
|||||||
<script src="{{url_for('static', filename='js/searchonaud.js') }}"></script>
|
<script src="{{url_for('static', filename='js/searchonaud.js') }}"></script>
|
||||||
<script src="{{url_for('static', filename='js/print.js') }}"></script>
|
<script src="{{url_for('static', filename='js/print.js') }}"></script>
|
||||||
<script src="{{url_for('static', filename='js/modal.js') }}"></script>
|
<script src="{{url_for('static', filename='js/modal.js') }}"></script>
|
||||||
|
<script src="{{url_for('static', filename='js/allmatc.js') }}"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user