- Home
- Forum
- Angular - EJ 2
- Is there a way to highlight recently updated files and folders?
Is there a way to highlight recently updated files and folders?
Our application is angular, nodejs based. We integrated syncfusion filemanager with our application and it's connected to Azure Blob. We need to show the recently updated files and folders highlighted.
SIGN IN To post a reply.
3 Replies
IL
Indhumathy Loganathan
Syncfusion Team
September 15, 2021 04:06 PM UTC
Hi Yamini,
Greetings from Syncfusion support.
We have validated your requirement in File Manager component. We understand that you want to highlight the currently updated file and folder. To achieve your requirement, we used our fileLoad event to compare the current date with the file/folder dateModified date. If the date matches, then we just highlight the color of the text.
Refer to the below code snippet.
|
[app.component.ts]
fileLoad(args) {
var today: any = new Date();
var dd = (String(today.getDate()) as any).padStart(2, '0');
var mm = (String(today.getMonth() + 1) as any).padStart(2, '0');
var yyyy = today.getFullYear();
//Get the current date
today = yyyy + '-' + mm + '-' + dd;
//Compare the current date with modified date.
if (today == args.fileDetails.dateModified.slice(0, 10)) {
if (args.element.getElementsByClassName('e-fe-text')[0] != null) {
//Add custom class to highlight the text.
args.element
.getElementsByClassName('e-fe-text')[0]
.classList.add('e-custom');
}
}
}
[app.component.css]
.e-custom {
color: red;
} |
You can find the sample demonstrating the solution from below link.
Service Provider: https://www.syncfusion.com/downloads/support/forum/168851/ze/ej2-azure-aspcore-file-provider-1609353918
Please check the sample and get back to us if you need any further assistance.
Regards,
Indhumathy L
YB
Yamini B
September 15, 2021 09:59 PM UTC
Hi, Thanks for the solution. But we are using Azure blob storage and Azure blob provides last modified date only for files but not at folder level. Below is the screenshot attached, you can see that only files have date_modified, for Folders it would be null.
If a file (abc) which is inside a folder (xyz) is modified, can we highlight both xyz and abc?
IL
Indhumathy Loganathan
Syncfusion Team
September 16, 2021 03:11 PM UTC
Hi Yamini,
We have validated your reported query, but the Azure file provider returns modified date for the folders as well. In our previous shared sample, when you try to modify the folder or the contents inside the folder then its parent folders also get highlighted based on the dateModified date value. For your reference, we have recorded the behavior of File Manager in the below video.
You can also check our demo sample for reference.
The Azure file service provider returns the dateModified field for the folders as well. Check the below link.
Kindly check whether you have performed any customization in your service provider. Also confirm whether you are facing the same issue in our shared sample as well. If so, please get back to us with an issue replicated sample and video footage of the issue.
Please let us know if you need any further assistance.
Regards,
Indhumathy L
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
YB Yamini B
- Sep 14, 2021 10:17 PM UTC
- Sep 16, 2021 03:11 PM UTC