Skip to content

Commit bf16e1a

Browse files
committed
bug fixed visualize table component
1 parent 1ba6e2a commit bf16e1a

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

zeppelin-distribution/src/bin_license/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ The text of each license is also included at licenses/LICENSE-[project]-[version
8585
(The MIT License) Angular Websocket v1.0.13 (http://angularclass.github.io/angular-websocket/) - https://github.com/AngularClass/angular-websocket/blob/v1.0.13/LICENSE
8686
(The MIT License) UI.Ace v0.1.1 (http://angularclass.github.io/angular-websocket/) - https://github.com/angular-ui/ui-ace/blob/master/LICENSE
8787
(The MIT License) jquery.scrollTo v1.4.13 (https://github.com/flesler/jquery.scrollTo) - https://github.com/flesler/jquery.scrollTo/blob/1.4.13/LICENSE
88+
(The MIT License) jquery.floatThead v1.3.2 (https://github.com/mkoryak/floatThead) - https://github.com/mkoryak/floatThead/blob/master/license.txt
8889
(The MIT License) angular-dragdrop v1.0.8 (http://codef0rmer.github.io/angular-dragdrop/#/) - https://github.com/codef0rmer/angular-dragdrop/blob/v1.0.8/LICENSE
8990
(The MIT License) perfect-scrollbar v0.5.4 (http://noraesae.github.io/perfect-scrollbar/) - https://github.com/noraesae/perfect-scrollbar/tree/0.5.4
9091
(The MIT License) ng-sortable v1.1.9 (https://github.com/a5hik/ng-sortable) - https://github.com/a5hik/ng-sortable/blob/1.1.9/LICENSE

zeppelin-web/bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"angular-filter": "~0.5.4",
2929
"ngtoast": "~1.5.5",
3030
"ng-focus-if": "~1.0.2",
31-
"bootstrap3-dialog": "bootstrap-dialog#~1.34.7"
31+
"bootstrap3-dialog": "bootstrap-dialog#~1.34.7",
32+
"floatThead": "~1.3.2"
3233
},
3334
"devDependencies": {
3435
"angular-mocks": "1.3.8"

zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -941,20 +941,17 @@ angular.module('zeppelinWebApp')
941941

942942

943943
var renderTable = function() {
944-
var html = '';
945944

946-
html += '<table class="table table-hover table-condensed" style="top: 0; position: absolute;">';
945+
var html = '';
946+
html += '<table class="table table-hover table-condensed">';
947947
html += ' <thead>';
948948
html += ' <tr style="background-color: #F6F6F6; font-weight: bold;">';
949949
for (var titleIndex in $scope.paragraph.result.columnNames) {
950950
html += '<th>'+$scope.paragraph.result.columnNames[titleIndex].name+'</th>';
951951
}
952952
html += ' </tr>';
953953
html += ' </thead>';
954-
html += '</table>';
955-
956-
html += '<table class="table table-hover table-condensed" style="margin-top: 31px;">';
957-
954+
html += ' <tbody>';
958955
for (var r in $scope.paragraph.result.msgTable) {
959956
var row = $scope.paragraph.result.msgTable[r];
960957
html += ' <tr>';
@@ -969,19 +966,28 @@ angular.module('zeppelinWebApp')
969966
}
970967
html += ' </tr>';
971968
}
972-
969+
html += ' </tbody>';
973970
html += '</table>';
974971

975972
angular.element('#p' + $scope.paragraph.id + '_table').html(html);
976973
if ($scope.paragraph.result.msgTable.length > 10000) {
977974
angular.element('#p' + $scope.paragraph.id + '_table').css('overflow', 'scroll');
978975
} else {
976+
var dataTable = angular.element('#p' + $scope.paragraph.id + '_table .table');
977+
dataTable.floatThead({
978+
scrollContainer: function (dataTable) {
979+
return angular.element('#p' + $scope.paragraph.id + '_table');
980+
}
981+
});
982+
angular.element('#p' + $scope.paragraph.id + '_table').css('position', 'relative');
983+
angular.element('#p' + $scope.paragraph.id + '_table').css('height', '100%');
984+
angular.element('.ps-scrollbar-y-rail').css('z-index', '1002');
985+
angular.element('#p' + $scope.paragraph.id + '_table').perfectScrollbar('destroy');
979986
angular.element('#p' + $scope.paragraph.id + '_table').perfectScrollbar();
980987
}
981-
982988
// set table height
983989
var height = $scope.paragraph.config.graph.height;
984-
angular.element('#p' + $scope.paragraph.id + '_table').height(height);
990+
angular.element('#p' + $scope.paragraph.id + '_table').css('height', height);
985991
};
986992

987993
var retryRenderer = function() {

zeppelin-web/src/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@
122122
<script src="bower_components/ngtoast/dist/ngToast.js"></script>
123123
<script src="bower_components/ng-focus-if/focusIf.js"></script>
124124
<script src="bower_components/bootstrap3-dialog/dist/js/bootstrap-dialog.min.js"></script>
125+
<script src="bower_components/floatThead/dist/jquery.floatThead.js"></script>
126+
<script src="bower_components/floatThead/dist/jquery.floatThead.min.js"></script>
125127
<!-- endbower -->
126128
<!-- endbuild -->
127129
<!-- build:js({.tmp,src}) scripts/scripts.js -->

zeppelin-web/test/karma.conf.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ module.exports = function(config) {
5656
'bower_components/ngtoast/dist/ngToast.js',
5757
'bower_components/ng-focus-if/focusIf.js',
5858
'bower_components/bootstrap3-dialog/dist/js/bootstrap-dialog.min.js',
59+
'bower_components/floatThead/dist/jquery.floatThead.js',
60+
'bower_components/floatThead/dist/jquery.floatThead.min.js',
5961
'bower_components/angular-mocks/angular-mocks.js',
6062
// endbower
6163
'src/app/app.js',

0 commit comments

Comments
 (0)