Roo/form/ComboBoxArray.js
[roojs1] / Roo / form / ComboBoxArray.js
index 0569f25..47d9caf 100644 (file)
@@ -277,6 +277,7 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
     {
         //Roo.form.ComboBoxArray.superclass.reset.call(this); 
         this.items.each(function(f) {
+            Roo.log(f);
            f.remove(); 
         });
         this.el.dom.value = '';
@@ -294,8 +295,6 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
          
         this.reset();
         
-        
-        
         if (this.store.isLocal && (typeof(v) == 'string')) {
             // then we can use the store to find the values..
             // comma seperated at present.. this needs to allow JSON based encoding..
@@ -469,11 +468,14 @@ Roo.extend(Roo.form.ComboBoxArray.Item, Roo.BoxComponent, {
             return;
         }
         
-        this.cb.items.remove(this);
-        this.el.child('img').un('click', this.remove, this);
-        this.el.remove();
-        this.cb.updateHiddenEl();
+        if(false !== this.cb.fireEvent('beforeremove', this.cb, this)){
+            this.cb.items.remove(this);
+            this.el.child('img').un('click', this.remove, this);
+            this.el.remove();
+            this.cb.updateHiddenEl();
+
+            this.cb.fireEvent('remove', this.cb, this);
+        }
         
-        this.cb.fireEvent('remove', this.cb, this);
     }
 });
\ No newline at end of file