To remove the drag-and-drop upload functionality in v21.1.38, try the following:
-
Ensure the
AllowDragAndDrop property is set to false correctly.
-
Use the
created event to modify the drop area.
Here's an updated approach:
function onFileManagerCreated() {
var fileObj = document.getElementById("file-controller").ej2_instances[0];
if (fileObj && fileObj.uploadObj) {
fileObj.uploadObj.dropArea = null;
} else {
console.error("File Manager or Upload Object not initialized properly.");
}
}
// Attach the function to the FileManager created event
document.getElementById("file-controller").addEventListener('created', onFileManagerCreated);
Make sure that the id "file-controller" is correct and that the script runs after the FileManager component is fully loaded.