Hi karthick,
Sorry for the inconvenience,
Please refer to the below link for adding the custom item to context menu of FileManager component.
Query1- fetching file path.
You can fetch the file/folder path by using filter path and name property in menuClick event argument.
Please, refer to the below code snippet.
<ejs-filemanager
#file
id="filemanager"
[ajaxSettings]="ajaxSettings"
[contextMenuSettings]="contextMenuSettings"
(menuOpen)="menuOpen($event)"
(menuClick)="menuClick($event)"
>
</ejs-filemanager>
menuClick(args) {
if (args.item.text === "Custom") {
for (var i in args.fileDetails) {
let name = args.fileDetails[i].filterPath + args.fileDetails[i].name;
console.log(name);
}
}
}
|
Please, refer to the sample link below.
If we have misunderstood your requirement, please share the below details to proceed further.
· Share us screenshot/video footage of your requirement.
· Share us the exact requirement and real-time use case scenario for FileManager component.
Please, refer to the below links for FileManager component.
Please let us know, if you need any further assistance.
Regards,
Sowmiya.P
Hello sowmiya,
thank you understanding the requirement.
this is what exactly what i want. i tried with your solution but its return null values kindly assist me to complete this problem.
<ejs-filemanager
#file
id="filemanager"
[ajaxSettings]="ajaxSettings"
(failure)="onFail($event)"
(beforeSend)="beforeSend($event)"
(beforeDownload)="beforeDownload($event)"
(beforeImageLoad)="beforeImageLoad($event)"
[contextMenuSettings]="contextMenuSettings"
(menuOpen)="menuOpen($event)"
(menuClick)="menuClick($event)">
</ejs-filemanager>
// event for custom menu item
menuClick(args) {
if (args.item.text === 'Share') {
for(var i in args.fileDetails)
{
console.log(args.fileDetails[i]);
let name = args.fileDetails[i].filterPath + args.fileDetails[i].name;
console.log(name);
alert(name);
}
}
}
Response:
--While click on folder select custom menu
action: null
caseSensitive: false
data: null
dateCreated: "0001-01-01T00:00:00"
dateModified: "0001-01-01T00:00:00"
filterId: null
filterPath: null
hasChild: false
id: null
isFile: false
name: "Test Three"
names: null
newName: null
parentId: null
path: null
permission: null
previousName: null
renameFiles: null
searchString: null
showHiddenItems: false
size: 0
targetData: null
targetPath: null
type: "Folder"
uploadFiles: null
_fm_created: "0000-12-31T18:06:32.000Z"
_fm_htmlAttr:
class: "e-large-icon"
title: "Test Three"
__proto__: Object
_fm_icon: "e-fe-folder"
_fm_iconClass: "e-fe-folder"
_fm_id: "fe_tree_0_0"
_fm_modified: "0000-12-31T18:06:32.000Z"
__proto__: Object
--while click on file select custom menu
action: null
caseSensitive: false
data: null
dateCreated: "2020-12-18T07:18:55-05:00"
dateModified: "0001-01-01T00:00:00"
filterId: null
filterPath: null
hasChild: false
id: null
isFile: true
name: "ironman1(1).jpg"
names: null
newName: null
parentId: null
path: null
permission: null
previousName: null
renameFiles: null
searchString: null
showHiddenItems: false
size: 9595
targetData: null
targetPath: null
type: ".jpg"
uploadFiles: null
_fm_created: "2020-12-18T12:18:55.000Z"
_fm_htmlAttr:
class: "e-large-icon"
title: "ironman1(1).jpg"
__proto__: Object
_fm_iconClass: "e-fe-image"
_fm_imageAttr:
alt: "ironman1(1).jpg"
__proto__: Object
_fm_imageUrl: "https://testapi.ikeyvault.com/v4/api/AmazonS3Provider/AmazonS3GetImage?path=/Test Two/ironman1(1).jpg&time=1610004692116&Authorization=Uvtv5BrC5nFy33ehAfQAkA%3D%3D"
_fm_modified: "0000-12-31T18:06:32.000Z"
__proto__: Object
In Above, I will given both response of file and folder. I can get only file or folder name and type alone. I am unable to get the path.
I have given "filterpath" is null. kindly check it.
let name = args.fileDetails[i].filterPath + args.fileDetails[i].name;
this is exactly what i want thank you.
-> https://stackblitz.com/edit/angular-rj2zau-ggbi9c?file=app.component.ts