X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=docs%2Fsymbols%2Fsrc%2FRoo_bootstrap_DocumentManager.js.html;h=f5f528586f3d408c31cd097454075138b35429bd;hb=55eaa96bc7c2a974413f6ef4c4f60fab80b13320;hp=c8b593538c68f293cdf8e1f458a95c05ff2cfa2f;hpb=3001f1efb6975abb2b30a6fc08bff0b7cc29f59f;p=roojs1 diff --git a/docs/symbols/src/Roo_bootstrap_DocumentManager.js.html b/docs/symbols/src/Roo_bootstrap_DocumentManager.js.html index c8b593538c..f5f528586f 100644 --- a/docs/symbols/src/Roo_bootstrap_DocumentManager.js.html +++ b/docs/symbols/src/Roo_bootstrap_DocumentManager.js.html @@ -8,6 +8,7 @@ * @extends Roo.bootstrap.Component * Bootstrap DocumentManager class * @cfg {String} paramName default 'imageUpload' + * @cfg {String} toolTipName default 'filename' * @cfg {String} method default POST * @cfg {String} url action url * @cfg {Number} boxes number of boxes, 0 is no limit.. default 0 @@ -26,6 +27,9 @@ Roo.bootstrap.DocumentManager = function(config){ Roo.bootstrap.DocumentManager.superclass.constructor.call(this, config); + this.files = []; + this.delegates = []; + this.addEvents({ /** * @event initial @@ -47,6 +51,13 @@ * @param {XMLHttpRequest} xhr */ "exception" : true, + /** + * @event afterupload + * Fire when xhr load exception + * @param {Roo.bootstrap.DocumentManager} this + * @param {XMLHttpRequest} xhr + */ + "afterupload" : true, /** * @event prepare * prepare the form data @@ -104,17 +115,16 @@ inputName : '', thumbSize : 300, multiple : true, - files : [], + files : false, method : 'POST', url : '', paramName : 'imageUpload', + toolTipName : 'filename', fieldLabel : '', labelWidth : 4, labelAlign : 'left', editable : true, - delegates : [], - - + delegates : false, xhr : false, getAutoCreate : function() @@ -484,6 +494,8 @@ this.arrange(); + this.fireEvent('afterupload', this, xhr); + }, xhrOnError : function(xhr) @@ -574,9 +586,22 @@ formData.append(this.paramName, file, file.name); - if(this.fireEvent('prepare', this, formData) != false){ + var options = { + file : file, + manually : false + }; + + if(this.fireEvent('prepare', this, formData, options) != false){ + + if(options.manually){ + return; + } + this.xhr.send(formData); + return; }; + + this.uploadCancel(); }, uploadCancel : function() @@ -585,7 +610,6 @@ this.xhr.abort(); } - this.delegates = []; Roo.each(this.managerEl.select('.roo-document-manager-loading', true).elements, function(el){ @@ -607,9 +631,9 @@ cn : [ { tag : 'div', - tooltip : file.filename, + tooltip : file[this.toolTipName], cls : 'roo-document-manager-thumb', - html : '<img src="' + baseURL +'/Images/Thumb/' + this.thumbSize + '/' + file.id + '/' + file.filename + '">' + html : '<img tooltip="' + file[this.toolTipName] + '" src="' + baseURL +'/Images/Thumb/' + this.thumbSize + '/' + file.id + '/' + file.filename + '">' }, { tag : 'button',