Skip to content

Commit

Permalink
Merge pull request #698 from onkelandy/http
Browse files Browse the repository at this point in the history
http module: also update responsive cell when visible
  • Loading branch information
onkelandy authored Dec 19, 2024
2 parents a4cb06c + 299eeaf commit 526ce4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion modules/http/webif/gstatic/datatables/datatables.defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ $(window).bind('datatables_defaults', function() {
//setTimeout(function() { $(window).resize(); }, 2000);

},
responsive: {details: {type: 'column', renderer: $.fn.dataTable.Responsive.renderer.listHidden()}}, //makes it possible to update columns even if they are not shown as columns (but as collapsable items)
responsive: {
details: {
type: 'column',
renderer: $.fn.dataTable.Responsive.renderer.listHidden()
}
}, //makes it possible to update columns even if they are not shown as columns (but as collapsable items)
preDrawCallback: function (oSettings) {

// scroll
Expand Down
5 changes: 4 additions & 1 deletion modules/http/webif/gstatic/js/smarthomeng.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ function shngInsertText (id, text, table_id=null, highlight=0) {
}
// update datatable cell
if (new_content) {
$('#' + table_id).DataTable().cell( $('#' + $.escapeSelector(id)) ).data(text);
let table = $('#' + table_id).DataTable();
table.cell( $('#' + $.escapeSelector(id)) ).data(text).invalidate();
table.responsive.rebuild();
table.responsive.recalc();
console.log("Updating table because new cell data found: " + text + " for id " + id + ", old text: " + old_text);
// $('#' + table_id).DataTable().draw(false);
}
Expand Down

0 comments on commit 526ce4a

Please sign in to comment.