From 86bc6adc2a3f91e75eb6ae813a8637ec56f0d900 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Thu, 11 May 2017 11:16:12 +0200 Subject: [PATCH] fix lost column updated name at sample page and bug with another user not able to view column dropdown --- app/assets/javascripts/samples/sample_datatable.js.erb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/samples/sample_datatable.js.erb b/app/assets/javascripts/samples/sample_datatable.js.erb index c0bbff776..a53a1ccad 100644 --- a/app/assets/javascripts/samples/sample_datatable.js.erb +++ b/app/assets/javascripts/samples/sample_datatable.js.erb @@ -154,7 +154,10 @@ function dataTableInit() { fnInitComplete: function(oSettings, json) { // Reload correct column order and visibility (if you refresh page) for (var i = 0; i < table.columns()[0].length; i++) { - var visibility = myData.columns[i].visible; + var visibility = false; + if (myData.columns[i]) { + visibility = myData.columns[i].visible; + } if (typeof (visibility) === 'string') { visibility = (visibility === 'true'); } @@ -976,7 +979,6 @@ function changeToEditMode() { // Add number of columns $('#samples').data('num-columns', $('#samples').data('num-columns') + 1); - // Add column to table (=table header) originalHeader.append( '