Running into an issue when trying to bring up the layout context menu by right clicking an empty space within the FileManager. The contextMenu works fine when right clicking on a file/folder.
The following is how I initialize the filemanager
// inject feature modules of the file manager
ej.filemanager.FileManager.Inject(ej.filemanager.DetailsView,ej.filemanager.Toolbar,ej.filemanager.NavigationPane);
// initialize File Manager component
var filemanagerInstance = 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'
},
allowDragAndDrop: true,
showThumbnail: false,
contextMenuSettings: {
layout: ["Paste", "SortBy", "View", "Refresh", "|", "NewFolder", "Upload", "|", "Details", "|", "SelectAll"],
file: ["Delete", "Cut", "Copy", "Paste", "Rename", "|", "Details"],
folder: ["Open", "|", "Delete", "Cut", "Copy", "Paste", "Rename", "|", "Details"],
visible: true
},
toolbarSettings:
{
items: ["NewFolder", "SortBy", "Refresh", "Upload Files", "View", "Details"]
},
beforePopupOpen: beforePopupOpen,
menuOpen: menuOpen,
menuClick: menuClick,
toolbarClick: toolbarClick,
beforeSend: beforeSend,
beforeImageLoad: beforeImageLoad,
toolbarCreate: toolbarCreate,
popupOpen: popupOpen,
uploadListCreate: uploadListCreate
});
// render initialized File Manager
filemanagerInstance.appendTo('#filemanager');
HTML:
<div id="filemanager" style="padding-top: 10px; padding-left: 10px; padding-right: 20px"></div>
I haven't been able to replicate the issue outside the application I'm currently implementing the filemanager in. I have a working sample outside the app but even when I copy that into the app itself, I still get the issue. The application it's running in is an aspx web application.
Here is the text of that console error
Uncaught TypeError: Cannot read properties of undefined (reading 'getRowObjectFromUID')
at e.onBeforeOpen (ej2.min.js:10)
at e.notify (ej2.min.js:10)
at t.e.trigger (ej2.min.js:10)
at t.triggerBeforeOpen (ej2.min.js:10)
at t.openMenu (ej2.min.js:10)
at t.cmenuHandler (ej2.min.js:10)
Is there anything in the way I'm initializing the filemanager that would cause this issue?
This error occurs before the menuclick event so I'm not able to debug it that way.
Is there any documentation on the onBeforeOpen function for the layout context menu? Or any information regarding that function that could help me resolve this issue? Like, what is the undefined object that is being referenced supposed to be?
Thanks for any help you may be able to provide.
I am using the latest version. I tried older versions and still get the issue.
Hi Sharon,
I am still not able to reproduce the issue outside the application.
As far as comparing both the sample with my application, I am not seeing any difference between them, as far as any syncfusion or filemanager related code.
Is there any way we could look at the target object that is showing up undefined in the error above?
If we know what the object is trying to reference within the onBeforeOpen function, maybe we could track down what the root cause is and if there is anything else on the app side that may be interfering with the syncfusion code.
-Daniel
Hi Daniel,
We understand that you are facing issues while opening context menu in File Manager specific to your application. We would like to let you know that, when using the DetailsView, the given condition related to the error gets executed. However, we have rechecked our sample with Details View, but we are unable to reproduce the mentioned issue. Please provide the following details, so that we can provide a prompt solution.
Please get back to us if you need any further assistance.
Regards,
Sharon Sanchez S.
After some more digging, I've found cause of the issue.
In my example, the SyncFusion File Manager is rendered within a <table> element.
I placed the file manager <div> outside that table element and the issue disappeared.
I don't know if this is a known issue or by design, but I will work around this for now.
Thanks