Browse Source

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

Enrico Berti 9 năm trước cách đây
mục cha
commit
8a8ba491fd

+ 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);