You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Our customer in Stackoverflow is using UseDirectoryBrowser to list the files on his server, he'd like to sort the listed files by created date and modified date, but there is not any places that we can config this, seems UseDirectoryBrowser does not have an option for that
Describe the solution you'd like
DirectoryBrowserOptions class can have another enum property named SortBy, value of this propery could be CreatedDate, ModifiedDate, or a combination such as CreatedDate|ModifiedDate. In the meantime, UseDirectoryBrowser will check this propery and take the sort options into consideration while rendering the file list in frontend
If we were to add such an option to DirectoryBrowserOptions then the sort would have to happen right before passing the data to the formatter here since there's no way to pass in options to the formatter:
Or maybe add it as an option directly on the HtmlDirectoryFormatter rather than DirectoryBrowserOptions and have you set the Formatter if you wanted to change it?
Your best bet in the short term is to replace DirectoryBrowserOptions.Formatter to customize the view. You can copy HtmlDirectoryFormatter and customize it to your liking.
Triage decision: The directory browser middleware is primarily intended for diagnostic scenarios. Unfortunately, we don't plan to do this. This is a great option to author a good third-party Directory Browser.
Is your feature request related to a problem? Please describe.
Our customer in Stackoverflow is using UseDirectoryBrowser to list the files on his server, he'd like to sort the listed files by created date and modified date, but there is not any places that we can config this, seems UseDirectoryBrowser does not have an option for that
Describe the solution you'd like
DirectoryBrowserOptions class can have another enum property named SortBy, value of this propery could be CreatedDate, ModifiedDate, or a combination such as CreatedDate|ModifiedDate. In the meantime, UseDirectoryBrowser will check this propery and take the sort options into consideration while rendering the file list in frontend
Additional context
Original post in stackoverflow as below
https://stackoverflow.com/questions/60850477/asp-net-directorybrowser-feature-how-to-control-sort
The text was updated successfully, but these errors were encountered: