FYI, we have just released FileUltimate v6.2.0 with this featue:
Added: New client-side events. Before events: ClientCreating, ClientDeleting, ClientRenaming, ClientCopying, ClientMoving, ClientCompressing, ClientExtracting, ClientUploading, ClientDownloading, ClientPreviewing. It's possible to stop a file action (and optionally display a message) by canceling the corresponding before event. After events: ClientFolderChanged, ClientSelectionChanged, ClientCreated, ClientDeleted, ClientRenamed, ClientCopied, ClientMoved, ClientCompressed, ClientExtracted, ClientUploaded. Refer to new "Client-side events" sample and updated docs for event handler usage.
Now you don't need any overrides anymore and you can directly use these client side events:
<head>
<script type="text/javascript">
function fileManagerFolderChanged(sender, e) {
var fileManager = sender;
//Pretty print the event arguments
var json = JSON.stringify(e, null, 2);
alert(json);
}
function fileManagerSelectionChanged(sender, e) {
var fileManager = sender;
//Pretty print the event arguments
var json = JSON.stringify(e, null, 2);
alert(json);
}
</script>
</head>
Binding JS event handlers in ASP.NET MVC:
var fileManager = new FileManager
{
ClientFolderChanged="fileManagerFolderChanged",
ClientSelectionChanged="fileManagerSelectionChanged"
};
Binding JS event handlers in ASP.NET WebForms:
<GleamTech:FileManager id="fileManager" runat="server"
ClientFolderChanged="fileManagerFolderChanged"
ClientSelectionChanged="fileManagerSelectionChanged" />
Sample outputs for these event handlers (pretty printing of event arguments):
//SAMPLE OUTPUT for ClientFolderChanged:
{
"eventName": "folderChanged",
"folder": {
"name": "Folder One",
"fullPath": "[1. Root Folder]:\\Folder One",
"itemType": "Folder"
}
}
//SAMPLE OUTPUT for ClientSelectionChanged:
{
"eventName": "selectionChanged",
"items": [
{
"name": "DOCX Document.docx",
"fullPath": "[1. Root Folder]:\\DOCX Document.docx",
"itemType": "File",
"extension": "docx",
"size": 84272
},
{
"name": "Folder One",
"fullPath": "[1. Root Folder]:\\Folder One",
"itemType": "Folder",
"extension": "",
"size": null
}
]
}
Getting current folder info and selection info when your buttons are clicked (without using FileManager events):
//Pretty print the current folder info when the your button is clicked
function myButton1Click() {
var folderInfo = fileManager.getFolderInfo();
var json = JSON.stringify(folderInfo, null, 2);
alert(json);
}
//SAMPLE OUTPUT:
/*
{
"name": "Folder One",
"fullPath": "[1. Root Folder]:\\Folder One",
"itemType": "Folder"
}
*/
//Pretty print the selection info when the your button is clicked
function myButton2Click() {
var selectionInfo = fileManager.getSelectionInfo();
var json = JSON.stringify(selectionInfo, null, 2);
alert(json);
}
//SAMPLE OUTPUT:
/*
[
{
"name": "DOCX Document.docx",
"fullPath": "[1. Root Folder]:\\DOCX Document.docx",
"itemType": "File",
"extension": "docx",
"size": 84272
},
{
"name": "Folder One",
"fullPath": "[1. Root Folder]:\\Folder One",
"itemType": "Folder",
"extension": "",
"size": null
}
]
*/