roojs-bootstrap.js
[roojs1] / roojs-bootstrap-debug.js
index 12493ad..c9c535d 100644 (file)
@@ -12528,6 +12528,7 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input,  {
                 {
                     tag: 'input',
                     type : 'hidden',
+                    nane : this.name,
                     value : this.value,
                     cls : 'd-none  form-control'
                 },
@@ -12721,7 +12722,7 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input,  {
             }
             
         ];
-
+        
         var cn = this.addxtype(
             {
                  
@@ -12752,7 +12753,16 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input,  {
         // dont' really need ot update items.
         // this.items.push(cn);
         this.fileCollection.add(cn);
-        this.updateInput();
+        
+        var _t = this;
+        var reader = new FileReader();
+        reader.onloadend = function(evt) {  
+            data.srcdata =  evt.target.result;
+            _t.updateInput();
+        };
+        reader.readAsDataURL(data.src);
+        
+        
         
     },
     removeCard : function(id)
@@ -12778,12 +12788,16 @@ Roo.extend(Roo.bootstrap.CardUploader, Roo.bootstrap.Input,  {
     
     updateInput : function()
     {
+        var i =0;
         var data = [];
-        this.fileCollection.each(function(e) {
+        this.fileCollection.forEach(function(e) {
             data.push(e.data);
+            
         });
-        
         this.inputEl().dom.value = JSON.stringify(data);
+        
+        
+        
     }