{
tag: 'input',
type : 'hidden',
+ nane : this.name,
value : this.value,
cls : 'd-none form-control'
},
}
];
-
+
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 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);
+
+
+
}