Dear support team,
I want to Get ID of current folder, but when I add action "Sign All", i have error when click "Sign All" button like this
Please show me how to get ID current folder when click action.
-
ABP Framework version: v4.2.2
-
UI type: Angular
-
DB provider: EF Core
-
Tiered (MVC) or Identity Server Separated (Angular): no
-
Exception message and stack trace:
-
Steps to reproduce the issue:
2 Answer(s)
-
0
Hello,
Let's talk about the hierarchy of
FileManagementModule
components.The root component is
FileManagementComponent
which containsabp-page
,file-management-buttons
,file-management-directory-tree
,file-management-folder-panel
.FileManagementFolderContentComponent
lies withinfile-management-folder-panel
and many more.So, the component tree looks like the following:
FileManagementComponent
-
PageComponent
-
FileManagementButtonsComponent
-
FileManagementDirectoryTreeComponent
-
FileManagementFolderPanelComponent
-
FileManagementFolderContentComponent
-
-
Now, let's look at your problem. The action you provided is being used in
FileManagementComponent
and passed to thePageComponent
which means at that level, you can only injectPageComponent
orFileManagementComponent
. Other components are stored in lower level of the tree and not available to you.To get the content of the current folder, here is what you can do
{ text: 'FileManagement::Sign All', action: (data) => { const component = data.getInjected(FileManagementComponent); const navigator = data.getInjected(NavigatorService); // component.currentContent => holds the list of current content, files & folders // navigator.getCurrentFolderId() => returns ID of the current folder, null if it is the root folder } }
-
-
0
Thanks bunyamin ,
Your answer is very clear.