hello dhtmlx-team,
we have a problem with form-events onBeforeFileAdd and onBeforeFileRemove.
The onFileAdd and onFileRemove events work fine.
May be you can explain us the error.
Our version dhtmlxSuite PRO 3.6.
setUploadForm = function() {
if (myForm) {
myForm.unload();
myForm = null;
}
var url = "modul/eakte/vault/importHandler.php?cmd=verUpl&r="+Util.rand();
fdata = [{type:"upload", name:"DOK", inputWidth:330, autoStart:false, url:url, swfUrl:url, swfPath:"js/dhtmlxForm/codebase/ext/uploader.swf"}];
myForm = new dhtmlXForm("myForm", fdata);
// NOT FIRE
myForm.attachEvent("onBeforeFileAdd",function(realName, size){
alert(realName);
return true;
});
// NOT FIRE
myForm.attachEvent("onBeforeFileRemove", function(realName, serverName){
alert(realName);
return true;
})
// FIRE AND WORKS FINE
myForm.attachEvent("onFileAdd",function(fileName) {
layout.progressOn();
// count check - only one file
var cnt = 0;
$$('div.dhx_file_name').each(function(e) {
cnt++;
if (cnt>1) {
$$('div.dhx_file_param.dhx_file_delete')[0].click();
}
});
// ajax extension check
if (!Util.isUplExtension(fileName)) {
$$('div.dhx_file_param.dhx_file_delete')[0].click();
}
layout.progressOff();
return true;
});
};
Sincerly from Munich
Christian Hörmann
B-A-U GmbH München