Browse Source

AMBARI-1326. Remake clearFilters function in app_view (part 3). (srimanth)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1441219 13f79535-47bb-0310-9956-ffa450edef68
Srimanth 12 years ago
parent
commit
9048709c09

+ 2 - 0
CHANGES.txt

@@ -36,6 +36,8 @@ Trunk (unreleased changes):
 
 
  IMPROVEMENTS
  IMPROVEMENTS
  
  
+ AMBARI-1326. Remake clearFilters function in app_view (part 3). (srimanth)
+ 
  AMBARI-1305. Make sure that Ambari Web renders all elements correctly when
  AMBARI-1305. Make sure that Ambari Web renders all elements correctly when
  the browser width is 1024px or narrower (refactor). (Arun Kandregula via 
  the browser width is 1024px or narrower (refactor). (Arun Kandregula via 
  yusaku) 
  yusaku) 

+ 24 - 0
ambari-web/app/controllers/main/apps_controller.js

@@ -310,6 +310,11 @@ App.MainAppsController = Em.ArrayController.extend({
       }
       }
       return tmp;
       return tmp;
     },
     },
+
+    /**
+     * Create link for server request
+     * @return {String}
+     */
     createAppLink:function(){
     createAppLink:function(){
       var link = "/jobhistory/datatable?";
       var link = "/jobhistory/datatable?";
 
 
@@ -386,6 +391,25 @@ App.MainAppsController = Em.ArrayController.extend({
     }
     }
   }),
   }),
 
 
+  /**
+   * reset all filters in table
+   *
+   */
+  clearFilters: function () {
+    var obj=this.get("filterObject");
+    obj.set("sSearch_0","");
+    obj.set("sSearch_1","");
+    obj.set("sSearch_2","");
+    obj.set("sSearch_3","");
+    obj.set("runType","Any");
+    obj.set("jobs","");
+    obj.set("input","");
+    obj.set("output","");
+    obj.set("duration","");
+    obj.set("runDate","Any");
+  },
+
+
   runUrl : "/jobhistory/datatable",
   runUrl : "/jobhistory/datatable",
   runTimeout : null,
   runTimeout : null,
 
 

+ 1 - 1
ambari-web/app/templates/main/apps.hbs

@@ -59,7 +59,7 @@
         ({{controller.filterObject.filteredDisplayRecords}})</a>
         ({{controller.filterObject.filteredDisplayRecords}})</a>
     </div>
     </div>
     <div class="span2 clear_filter">
     <div class="span2 clear_filter">
-        <a {{action "clearFilters" target="view"}}>{{t apps.filters.clearFilters}}</a>
+        <a {{action "clearFilters" target="controller"}}>{{t apps.filters.clearFilters}}</a>
     </div>
     </div>
     <div class="search-bar">
     <div class="search-bar">
         {{view view.appSearchThrough valueBinding="controller.filterObject.sSearch"}}
         {{view view.appSearchThrough valueBinding="controller.filterObject.sSearch"}}

+ 0 - 17
ambari-web/app/views/main/apps_view.js

@@ -285,23 +285,6 @@ App.MainAppsView = Em.View.extend({
     this.set("controller.filterObject.viewTypeClickEvent", false);
     this.set("controller.filterObject.viewTypeClickEvent", false);
   }.observes("controller.filterObject.viewType"),
   }.observes("controller.filterObject.viewType"),
 
 
-  /**
-   * reset all filters in table
-   *
-   */
-  clearFilters: function (event) {
-    this.set("controller.filterObject.sSearch_0","");
-    this.set("controller.filterObject.sSearch_1","");
-    this.set("controller.filterObject.sSearch_2","");
-    this.set("controller.filterObject.sSearch_3","");
-    this.set("controller.filterObject.runType","Any");
-    this.set("controller.filterObject.jobs","");
-    this.set("controller.filterObject.input","");
-    this.set("controller.filterObject.output","");
-    this.set("controller.filterObject.duration","");
-    this.set("controller.filterObject.runDate","Any");
-  },
-
   /**
   /**
    * This Container View is used to render static table row(appTableRow) and additional dynamic content
    * This Container View is used to render static table row(appTableRow) and additional dynamic content
    */
    */