SOLVED

Sharepoint JSON Formatting - InlineEditField - Set Size

Copper Contributor

Hi All,

Is there any way to set the size of "inlineeditfield" controls in the Sharepoint JSON Column Formatter.  Sometimes it is a bit smaller than I would like.  My gut feel is no, but it doesn't hurt to ask.  If not, why not and how do I request enhancements from Microsoft?

 

Thanks

James

3 Replies

@JMD2000 

 

You can set fixed width for JSON element like this: 

 

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField",
  "inlineEditField": "@currentField",
  "style": {
    "width": "100px"
  }
}

 

When you don't mention the width, InlineEditField is auto adjusted based on your column width. You can change column width by following this: SharePoint Modern List - Increase column width with JSON Issue 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Thanks @ganeshsanap - won't that set both the display field width AND the inline edit field width? I am asking whether it is possible to set only the width (and height in some cases) of the inline edit field, while keeping the display field a different width. I will experiment when back at in the office tomorrow.
best response confirmed by JMD2000 (Copper Contributor)
Solution

@JMD2000 

 

Definitely not possible using the simple JSON like given above.

 

When you set the width to parent element it will be applied for whole column. You may be able to achieve it by creating multiple elmType and setting different width for them.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.