Skip to content

Instantly share code, notes, and snippets.

@juanchehin
Created December 27, 2022 13:19
Show Gist options
  • Save juanchehin/f27d7ce90fc768a0a1c51445848dd776 to your computer and use it in GitHub Desktop.
Save juanchehin/f27d7ce90fc768a0a1c51445848dd776 to your computer and use it in GitHub Desktop.
function get_rows_gastos_fecha()
{
//before_send();
table_body.html("<tr><td colspan='<?=sizeof($this->columns)?>' style='font-weight:600;text-align:center'>Espere...</td></tr>");
var fechaGasto = document.getElementById("fecha-gasto").value;
console.log("table_body row 11 : ",table_body);
console.log("table_body id row 11 : ",table_body[0].id);
console.log("rows id row 11 : ",table_body[0].rows);
console.log("rows id row 11 : ",table_body[0].rows.length);
var idTable = table_body[0].id;
var table = document.getElementById(idTable);
console.log("table row 11 : ",table);
console.log("table.rows.length row 11 : ",table.rows.length);
// values contiene los nombres de los id de los filtros
$.post('!' + 'AdminGastos/getRows?fechaGasto=' + fechaGasto, values, function (result) {
table_body.html(result);
console.log("result row 1 : ",result);
row_count = parseInt(table_body.find('[data-count]').data("count"));
console.log("count row 1 : ",row_count);
if ( !isNaN(row_count) )
{
document.getElementById('records_count').innerHTML = "N&deg; de Registros: <b>" + row_count + "</b>";
}
//before_send();
if ( row_count < 1 )
{
table_body.html("<tr class='dt-empty'><td colspan='15' id='dt-empty' align='center'><?=$this->empty_table_text?></td></tr>");
return;
}
//----
<?php if($this->responsive_show_label): echo "\n"; ?>
var header_count = $('table.data-table th').length;
if ( header_count > 0 )
{
table_body.find('tr:not(.not) td').each(function (k, v) {
if ( (k + 1) % header_count )
{
//$(v).prepend("<h5 class='hlabel'>" + $('#column-' + (v.cellIndex + 1)).text() + "</h5>");
v.insertAdjacentHTML('afterbegin', "<h5 class='hlabel'>" + $('#column-' + (v.cellIndex + 1)).text() + "</h5>");
}
});
}
<?php endif; echo "\n";?>
});
setLS(table, JSON.stringify(values));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment