Roo/form/ComboBoxArray.js
[roojs1] / Roo / form / ComboBoxArray.js
index e2482d6..5afa5e2 100644 (file)
@@ -275,10 +275,12 @@ Roo.extend(Roo.form.ComboBoxArray, Roo.form.TextField,
     
     reset : function()
     {
-        //Roo.form.ComboBoxArray.superclass.reset.call(this); 
-        this.items.each(function(f) {
-           f.remove(); 
+        this.items.clear();
+        
+        Roo.each(this.outerWrap.select('.x-cbarray-item', true).elements, function(el){
+           el.remove();
         });
+        
         this.el.dom.value = '';
         if (this.hiddenEl) {
             this.hiddenEl.dom.value = '';
@@ -469,7 +471,7 @@ Roo.extend(Roo.form.ComboBoxArray.Item, Roo.BoxComponent, {
             return;
         }
         
-        if(false !== this.cb.fireEvent('remove', this.cb, this)){
+        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();