2

I noticed, as soon as I apply any sort of formatting to SharePoint existing columns it looses its context menu.

I tried the column formatter JSON as well as field customizer.

Is there a way we can keep the context menu as it is and do our formatting or if we have any JSON/or anything in field customizer extension, to bring back the context menu?

2
  • 1
    What is the JSON code you are using for formatting? Can you please add any screenshot or anything for more clarification? Commented Jul 8, 2019 at 6:10
  • 1
    @GaneshSanap, use any JSON for example { "$schema": "developer.microsoft.com/json-schemas/sp/…", "elmType": "div", "txtContent": "@currentField" }, using it on document lib name column
    – user4205
    Commented Jul 8, 2019 at 6:15

1 Answer 1

0

SharePoint Online JSON formatting now supports opening context menu easily by using openContextMenu action under customRowAction property.

For example:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField",
  "customRowAction": {
    "action": "openContextMenu"
  },
  "style": {
    "color": "green"
  }
}

Output:

enter image description here

Note: It shows context menu on click of formatted column.

Documentation: SharePoint JSON Formatting syntax reference - customRowAction

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.