Переглянути джерело

AMBARI-14879 Alerts page pagination issue.(ababiichuk)

ababiichuk 9 роки тому
батько
коміт
94c13eee7f
1 змінених файлів з 11 додано та 5 видалено
  1. 11 5
      ambari-web/app/views/common/table_view.js

+ 11 - 5
ambari-web/app/views/common/table_view.js

@@ -75,12 +75,18 @@ App.TableView = Em.View.extend(App.UserPref, {
   willInsertElement: function () {
     var self = this;
     var name = this.get('controller.name');
-    if (!this.get('displayLength') && this.get('state') !== "inBuffer") {
-      if (App.db.getDisplayLength(name)) {
-        self.set('displayLength', App.db.getDisplayLength(name));
-        Em.run.next(function () {
+    if (!this.get('displayLength')) {
+      var displayLength = App.db.getDisplayLength(name);
+      if (displayLength) {
+        if (this.get('state') !== "inBuffer") {
+          self.set('displayLength', displayLength);
           self.initFilters();
-        });
+        } else {
+          Em.run.next(function () {
+            self.set('displayLength', displayLength);
+            self.initFilters();
+          });
+        }
       } else {
         if (!$.mocho) {
           this.getUserPref(this.displayLengthKey()).complete(function () {