Roo/form/ComboBoxArray.js
[roojs1] / Roo / View.js
index 9123b37..8204faf 100644 (file)
@@ -49,6 +49,8 @@
  */
 Roo.View = function(config, depreciated_tpl, depreciated_config){
     
+    this.parent = false;
+    
     if (typeof(depreciated_tpl) == 'undefined') {
         // new way.. - universal constructor.
         Roo.apply(this, config);
@@ -73,9 +75,6 @@ Roo.View = function(config, depreciated_tpl, depreciated_config){
     
     this.tpl.compile();
     
-    this.tickItems = [];
-    
-     
     /** @private */
     this.addEvents({
         /**
@@ -284,10 +283,16 @@ Roo.extend(Roo.View, Roo.util.Observable, {
             
             if(this.tickable){
                 Roo.apply(d, {'roo-id' : Roo.id()});
-            }
+                
+                var _this = this;
             
-            Roo.log(data);
-            Roo.log(this.tickItems.indexOf(data));
+                Roo.each(this.parent.item, function(item){
+                    if(item[_this.parent.valueField] != data[_this.parent.valueField]){
+                        return;
+                    }
+                    Roo.apply(d, {'roo-data-checked' : 'checked'});
+                });
+            }
             
             html[html.length] = Roo.util.Format.trim(
                 this.dataName ?
@@ -588,6 +593,7 @@ Roo.extend(Roo.View, Roo.util.Observable, {
         if(!keepExisting){
             this.clearSelections(true);
         }
+        
         if(this.fireEvent("beforeselect", this, node, this.selections) !== false){
             Roo.fly(node).addClass(this.selectedClass);
             this.selections.push(node);