Hi, everyone.
Is there a way I can get the contents (the button and input field) of the rename popup dialog from FileManager for ASP.NET Core?
If it can be done with JavaScript, please let me know
Thanks in advance!
Got it. If anyone out there comes to this problem, what you can do is use popUpOpen or popUpClose FileManager
methods in JavaScript to get HTML div element of the rename popup dialog and get the input field or button contents like so:
function popUpClose(args){ if (args.popupName == 'Rename') { var arr = [].slice.call(args.popupModule.element.getElementsByTagName('input')); alert(arr[0].value); } }
It's an ugly way to do it, but you get the gist of it.
Hi Farai,
Greetings from Syncfusion support.
Thanks for the suggestion. You can also fetch this using the success event to get the renamed files or folder names.
Please refer to the code snippet.
|
[index.cshtml]
<ejs-filemanager id="filemanager" created="onCreated" success="onSuccess" > <e-filemanager-ajaxsettings url=https://ej2-aspcore-service.azurewebsites.net/api/FileManager/FileOperations downloadUrl=https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Download uploadUrl=https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Upload getImageUrl=https://ej2-aspcore-service.azurewebsites.net/api/FileManager/GetImage> </e-filemanager-ajaxsettings> </ejs-filemanager>
<script>
function onSuccess(args){ if(args.action=="rename"){ console.log(args.result.files[0].name); } } </script> |
For your reference, we have attached the sample.
Please check the shared sample and let us know if you need any further assistance.
Regards,
Prasanth Madhaiyan.
Hi, Prasanth Madhaiyan
Thank you! Your solution is way better than mine lol. I've marked yours as the answer.
Hi Farai,
We are glad that the shared solution is suitable for you. Please get back to us if you need any further assistance.
Regards,
Indhumathy L