From 0c6de66411d990fcd28278ec396456203acef805 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Sun, 24 Mar 2013 11:28:36 +0100 Subject: [PATCH] turn of problematic setting of dataTable when a hazelnut plugin is embedded in a Tabs object and not visible at the time the data shows up, then it used to end up empty turning off sScrollX fixes this problem - side-effect is not yet clear to me --- plugins/hazelnut/hazelnut.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/hazelnut/hazelnut.js b/plugins/hazelnut/hazelnut.js index 596062c2..2f7ec5ea 100644 --- a/plugins/hazelnut/hazelnut.js +++ b/plugins/hazelnut/hazelnut.js @@ -127,7 +127,8 @@ // http://datatables.net/forums/discussion/5331/datatables-warning-...-requested-unknown-parameter/p2 aoColumnDefs: [{sDefaultContent: '',aTargets: [ '_all' ]}], bRetrieve: true, - sScrollX: '100%', /* Horizontal scrolling */ + // xxx this one causes tables in a 'tabs' that are not exposed at the time this is run to show up empty + // sScrollX: '100%', /* Horizontal scrolling */ bProcessing: true, /* Loading */ fnRowCallback: function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { $(nRow).attr('id', get_value(aData[3])); @@ -329,6 +330,7 @@ }); + this.table.fnClearTable(); if (debug) console.log("hazelnut.update_plugin: total of " + newlines.length + " rows"); this.table.fnAddData(newlines); -- 2.43.0