Change Event

Hello

I am looking for an event to detect any kind of change to a file/folder, after the change happened and is reflected in the file system.

Since I could not find anything in the documentation I combined the following events:

  • CreateFolder
  • Drop
  • Paste
  • Remove
However, there does not seem to be an event for "Rename"?

Is there a better way to detect any changes to a file/folder?


Kind regards
Phil

3 Replies

AB Ashokkumar Balasubramanian Syncfusion Team October 19, 2017 12:49 PM UTC

Hi Phil   
   
Thanks for contacting Syncfusion Support.   
   
We have analyzed your requirement (“Looking for an event to detect any kind of change to a file/folder”). Currently, we don’t have a separate event for rename operation. But we were able to achieve this requirement by using BeforeAjaxRequest event of FileExplorer component. Please check the below code block.    
    
[CSHTML]    
    
@(Html.EJ().FileExplorer("fileExplorer").Path("~/Content/images/FileExplorer/").AjaxAction(@Url.Content("FileActionDefault")).ClientSideEvents(evt=>evt.BeforeAjaxRequest("onBeforeAjaxRequest")).IsResponsive(true)    
)    
    
    
[Script]    
    
function onBeforeAjaxRequest(params) {    
        if (params.ajaxSettings.data.ActionType == "Rename") {    
            params.ajaxSettings.successAfter = function (params) {    
                alert("File or Folder Renamed Sucessfully");    
            }    
        }    
    }    
 
    
To know more details about the BeforeAjaxRequest event, please refer the below help document.     
     
    
Regards,   
Ashokkumar B.   



UN Unknown October 19, 2017 01:09 PM UTC

Hello

That is exactly what I was looking for.

Thank you a lot.


Kind regards

Phil



AB Ashokkumar Balasubramanian Syncfusion Team October 20, 2017 04:02 AM UTC

Hi Phil,  
  
Most Welcome.  
  
Please let us know if you need any further assistance.  
  
Regards,  
Ashokkumar B.  


Loader.
Up arrow icon