Bold BI®Unlock stunning dashboards with Bold BI®: 35+ widgets, 150+ data sources, AI agent & more. Try it for free!
Hello,
I uploaded a file to the file manager control. The upload success popup appears and the uploaded file is listed on the popup and gird. After press delete icon in the popup, the file is deleted from the popup but not from the grid.
Is there any way to delete the file out of the box from the grid or to call an API to delete the file from the grid ?
Thanks
[index.js] var hostUrl = 'http://localhost:62869/'; var fileObject = new ej.filemanager.FileManager({ ajaxSettings: { url: hostUrl + 'api/FileManager/FileOperations', getImageUrl: hostUrl + 'api/FileManager/GetImage', uploadUrl: hostUrl + 'api/FileManager/Upload', downloadUrl: hostUrl + 'api/FileManager/Download', }, ..... created: OnCreated }); fileObject.appendTo('#filemanager'); function OnCreated(){ fileObject.uploadObj.removing = function (args){ args.cancel = true; fileObject.deleteFiles([args.filesData[0].name]); } } |
Thank you so much. you solution works like charm. However, after the file gets deleted from the grid, it doesn't get deleted from the popup.
[index.js] function OnCreated() { fileObject.uploadObj.removing = function (args) { if (args.event != null) { args.customFormData = [ { path: fileObject.path }, { size: args.filesData.size }, { action: 'remove' }, { data: null }, { filename: args.filesData.name }, ]; if (fileObject.uploadObj.fileList.length == 1) { fileObject.uploadDialogObj.hide(); } } }; } |