[pve-devel] r5811 - pve-manager/pve2/www/new/grid

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Apr 18 10:33:35 CEST 2011


Author: dietmar
Date: 2011-04-18 10:33:35 +0200 (Mon, 18 Apr 2011)
New Revision: 5811

Modified:
   pve-manager/pve2/www/new/grid/ResourceGrid.js
Log:
fix filter


Modified: pve-manager/pve2/www/new/grid/ResourceGrid.js
===================================================================
--- pve-manager/pve2/www/new/grid/ResourceGrid.js	2011-04-12 11:36:00 UTC (rev 5810)
+++ pve-manager/pve2/www/new/grid/ResourceGrid.js	2011-04-18 08:33:35 UTC (rev 5811)
@@ -2,7 +2,6 @@
 // this hack is required for ExtJS beta2
 Ext.override(Ext.grid.feature.Chunking, {
     attachEvents: function() {
-	console.log("TESTCF");
         var grid = this.view.up('gridpanel'),
             scroller = grid.down('gridscroller[dock=right]');
         if (scroller === null ) {
@@ -47,10 +46,10 @@
 
 	var textfilter_match = function(item) {
 	    var match = false;
-	    Ext.each(['name', 'storage', 'node', 'type'], function(field) {
+	    Ext.each(['name', 'storage', 'node', 'type', 'text'], function(field) {
 		var v = item.data[field];
 		if (v !== undefined) {
-		    v = v.toLowerCase();
+		    v = String(v).toLowerCase();
 		    if (v.indexOf(textfilter) >= 0) {
 			match = true;
 			return false;
@@ -76,12 +75,12 @@
 
                 for (; i < len; i++) {
                     n = cs[i];
-		    if (textfilter && !textfilter_match(n))
-			continue;
 
 		    var orgnode = rstore.data.get(n.data.id);
-		    if (orgnode)
-			nodeidx[n.data.id] = rstore.data.get(n.data.id);
+		    if (orgnode) {
+			if (!textfilter || textfilter_match(n))
+			    nodeidx[n.data.id] = rstore.data.get(n.data.id);
+		    }
  		    gather_child_nodes(n);
 		}
  	    };
@@ -124,7 +123,7 @@
 		store.model.prototype.fields.eachKey(function(field) {
 		    if (field != 'id' && item.data[field] != olditem.data[field]) {
 			changes = true;
-			console.log("changed item " + item.id + " " + field + " " + item.data[field] + " != " + olditem.data[field]);
+			//console.log("changed item " + item.id + " " + field + " " + item.data[field] + " != " + olditem.data[field]);
 			olditem.beginEdit()
 			olditem.set(field, item.data[field]);
 		    }




More information about the pve-devel mailing list