backoffice/dist/js/helpers.js

15 lines
339 B
JavaScript
Raw Normal View History

function getPaliersTable(tableId){
let table = [];
$(`#${tableId} tr`).has('td').each(function () {
var arrayItem = {};
$('td', $(this)).each(function (index, item) {
if (index < 4){
let val = parseFloat($(item).html())
arrayItem[index] = !isNaN(val) ? val : null;
}
});
table.push(arrayItem);
});
return table
}