Explorar o código

AMBARI-1312. Remake clearFilters function in app_view (part2). (Arun Kandregula via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1440775 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako %!s(int64=12) %!d(string=hai) anos
pai
achega
cfa2701399
Modificáronse 2 ficheiros con 20 adicións e 18 borrados
  1. 3 0
      CHANGES.txt
  2. 17 18
      ambari-web/app/views/main/apps_view.js

+ 3 - 0
CHANGES.txt

@@ -35,6 +35,9 @@ Trunk (unreleased changes):
  accessible for demo/test purposes. (mahadev)
 
  IMPROVEMENTS
+
+ AMBARI-1312. Remake clearFilters function in app_view (part2). (Arun Kandregula
+ via yusaku) 
  
  AMBARI-1309. Remove all text from Apps views, controllers, templates to 
  messages.js. (Arun Kandregula via yusaku)

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

@@ -66,8 +66,14 @@ App.MainAppsView = Em.View.extend({
     }
   }),
 
+  /**
+   * If there are table rows with runs.
+   */
   emptyData:true,
 
+  /*
+   If no runs to display set emptyData to true and reset Avg table data, else to set emptyData to false.
+   */
   emptyDataObserver:function(){
     //debugger;
     if(this.get("controller.paginationObject.iTotalRecords") != null && this.get("controller.paginationObject.iTotalDisplayRecords")>0){
@@ -83,7 +89,6 @@ App.MainAppsView = Em.View.extend({
    * View for RunPerPage select component
    */
   runPerPageSelectView: Em.Select.extend({
-
     selected: '10',
     content: ['10', '25', '50', '100']
   }),
@@ -267,26 +272,20 @@ App.MainAppsView = Em.View.extend({
   }.observes("controller.filterObject.viewType"),
 
   /**
-   * reset all filters in dataTable
+   * reset all filters in table
    *
-   * @param event
    */
   clearFilters: function (event) {
-    this._childViews.forEach(function (item) {
-      if (item.get("viewName") === "runPerPageSelectView") {
-        return "";
-      }
-      if (item.get('tagName') === 'input') {
-        item.set('value', '');
-      }
-      if (item.get('tagName') === 'select') {
-        item.set('value', 'Any');
-        item.change();
-      }
-      if (item.get('multiple')) {
-        item.get('clearFilter')(item);
-      }
-    });
+    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");
   },
 
   /**