浏览代码

HUE-5003 [core] Prevent JS error on calling scroll to column on just initialized HueDataTables

Enrico Berti 9 年之前
父节点
当前提交
8a8ba491fd
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      desktop/core/src/desktop/static/desktop/js/jquery.huedatatable.js

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/jquery.huedatatable.js

@@ -513,7 +513,7 @@
           self.$table.data('isScrollAttached', true);
           var scrollFn = function () {
             window.clearTimeout(drawTimeout);
-            drawTimeout = window.setTimeout(self.fnDraw, Math.max(100, Math.min(self.$table.data('aoColumns').length, 500)));
+            drawTimeout = window.setTimeout(self.fnDraw, Math.max(100, Math.min(self.$table.data('aoColumns') ? self.$table.data('aoColumns').length : 500, 500)));
           }
           self.$table.parents(oInit['scrollable']).data('scrollFnDt', scrollFn);
           self.$table.parents(oInit['scrollable']).on('scroll', scrollFn);