}
];
-
+
var cn = this.addxtype(
{
// 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)
updateInput : function()
{
- var data = [];
- var reader = new FileReaderSync();
- this.fileCollection.each(function(e) {
- var ee = Roo.apply({}, e);
- ee.src = 'data:' + e.mimetype +';base64,' + reader.readAsDataURL(blob);
- data.push(ee.data);
+ var data = [];
+ this.fileCollection.forEach(function(e) {
+ data.push(e.data);
+
});
-
this.inputEl().dom.value = JSON.stringify(data);
- },
- blobtoBase64 : function(blob) {
-
- return reader.readAsDataURL(blob);
- },
+
+ }
});