Attaching a context menu to DetailsList column headers in Fluent UI

I wanted to show a menu when clicking the column headers of a DetailsList, similar to how SharePoint does it. Fluent UI 8 does not have any built in support for this, so I had to figure out a way to do it myself.

Here is a sample project showing my solution. When clicking the column headers you get a menu allowing you to sort the list based on that column. Not very existing, but it shows how to dynamically build and position the context menu, and how to handle when the user selects a menu option depending on the column.

Get the full project code on GitHub

Most of the files are just generated boilerplace code. The interesting part is App.tsx:

 

This entry was posted in Development and tagged , , , , . Bookmark the permalink.

One Response to Attaching a context menu to DetailsList column headers in Fluent UI

  1. HARSHIT says:

    IN SHORT= provide an update to flash renamer

    hello I have been using many renaming softwares earlier, but once I started using the context menu of flash renamer, there is no competition out there in windows. I can just click multiple files and do the renaming as desired Through context menu , but there are some bugs and features that are missing in flash renamer.

    1} I cannot select and rename multiple folders through context menu of Flash Renamer.
    2} the flash renamer does not truncate aka restrict aka trim the length name of the file to 75 characters as I want. {Like suppose there is a file with name length more than 75 characters, I want to limit the file name length to 75 characters(including suffix and prefix) from the context menu.

    original NAME 1= 1st23456789——–75th—100th (NUMBER = CHARACTER LENGTH)
    my desired name= (prefix)001———-XYZ(suffix)= total character length to remain 75 as i desire.

    3) better ui.

Leave a Reply

Your email address will not be published. Required fields are marked *