Forum Discussion
CH4646
May 31, 2024Copper Contributor
Wrap single line text in the Title Column so that it breaks while maintaining hover/single click.
MarkBAndR was very helpful in another thread, and recommended I add this here. I have a Sharepoint List (in List view) being fed from a Microsoft Form. The List has a PowerApp that opens to show ...
- May 31, 2024
Hi CH4646
You need to add:
"customRowAction": { "action": "defaultClick" }https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-syntax-reference#customrowaction
If you like the JSON you currently have, it would become:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "style": { "box-sizing": "border-box", "padding": "0 2px", "overflow": "hidden", "text-overflow": "ellipsis" }, "attributes": { "class": "sp-field-fontSizeMedium" }, "txtContent": "[$Title]", "customRowAction": { "action": "defaultClick" } }If you want it to look just like standard SharePoint, then you would use:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "button", "style": { "box-sizing": "border-box", "padding": "0 2px", "overflow": "hidden", "text-overflow": "ellipsis" }, "attributes": { "class": "ms-Link root_137a7565 nameField_c45bee6b clickable_c45bee6b " }, "txtContent": "[$Title]", "customRowAction": { "action": "defaultClick" } }That has all the same formatting in the "class"
-Mark
MarkBAndR
May 31, 2024Copper Contributor
Hi CH4646
You need to add:
"customRowAction": {
"action": "defaultClick"
}https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-syntax-reference#customrowaction
If you like the JSON you currently have, it would become:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"box-sizing": "border-box",
"padding": "0 2px",
"overflow": "hidden",
"text-overflow": "ellipsis"
},
"attributes": {
"class": "sp-field-fontSizeMedium"
},
"txtContent": "[$Title]",
"customRowAction": {
"action": "defaultClick"
}
}If you want it to look just like standard SharePoint, then you would use:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"style": {
"box-sizing": "border-box",
"padding": "0 2px",
"overflow": "hidden",
"text-overflow": "ellipsis"
},
"attributes": {
"class": "ms-Link root_137a7565 nameField_c45bee6b clickable_c45bee6b "
},
"txtContent": "[$Title]",
"customRowAction": {
"action": "defaultClick"
}
}That has all the same formatting in the "class"
-Mark
CH4646
May 31, 2024Copper Contributor
Thank you Mark. This worked perfectly. Thank you so much for all your help. You're the best.
-Chris
-Chris