Roo/bootstrap/CardUploader.js
authorAlan Knowles <alan@roojs.com>
Wed, 25 Nov 2020 08:24:56 +0000 (16:24 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 25 Nov 2020 08:24:56 +0000 (16:24 +0800)
Roo/bootstrap/CardUploader.js

index 840bd89..21dee55 100644 (file)
@@ -280,7 +280,7 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input,  {
             }
         );
         // dont' really need ot update items.
-        //this.items.push(cn);
+        // this.items.push(cn);
         this.fileCollection.add(cn);
         
     },
@@ -294,9 +294,21 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input,  {
         card.el.dom.parentNode.removeChild(card.el.dom);
         
     },
+    reset: function()
+    {
+        this.fileCollection.each(function(card) {
+            card.el.dom.parentNode.removeChild(card.el.dom);    
+        });
+        this.inputEl().dom.value = '[]';
+    },
+    
     updateInput : function()
     {
-        this.fileCo
+        var data = [];
+        this.fileCollection.each(function(e) {
+            data.push(e.data);
+        });
+        this.inputEl().dom.value = JSON.stringify(data);
     }