SharePoint modern json formatting新支持的功能

1.文件预览

原本的elmType属性新增一个filepreview,并在attribute属性中添加值为@thumbnail.Size.
Demo:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "filepreview",
  "attributes": {
    "src": "@thumbnail.medium"
  },
  "style": {
    "display": "block",
    "margin": "0 auto",
    "max-height": "100px"
  },
  "customCardProps": {
    "openOnEvent": "hover",
    "isBeakVisible": true,
    "formatter": {
      "elmType": "img",
      "attributes": {
        "src": "@thumbnail.200x400"
      },
      "style": {
        "max-height": "400px"
      }
    }
  }
}

在这里插入图片描述
文档地址:https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-syntax-reference#filepreview

调整List按钮顺序或隐藏或改变图标

在view formatting中新增commandBarProps属性,可以对对command bar按钮进行自定义修改。
所有支持的按钮:

'new'
'newFolder'
'newWordDocument'
'newExcelWorkbook'
'newPowerPointPresentation'
'newOneNoteNotebook'
'newFormsForExcel'
'newVisioDrawing'
'upload'
'uploadFile'
'uploadFolder'
'open'
'share'
'copyLink'
'download'
'rename'
'copyTo'
'moveTo'
'delete'
'edit'
'comment'
'editNewMenu'
'powerBI'
'powerBIVisualizeList'
'automate'
'automateCreateRule'
'automateManageRules'
'powerAutomate'
'powerAutomateCreateFlow'
'powerAutomateSeeFlows'
'powerAutomateConfigureFlows'
'aiBuilderCreate'
'aiBuilderGoto'
'aiBuilder'
'alertMe'
'newLink'
'integrate'
'manageAlert'
'powerApps'
'powerAppsCreateApp'
'powerAppsSeeAllApps'
'powerAppsCustomizeForms'
'viewDocumentUnderstandingModels'
'versionHistory'
'openInImmersiveReader'
'classifyAndExtract'
'checkOut'
'checkIn'
'undoCheckOut'
'properties'
'pinItem'
'exportExcel'
'exportCSV'
'export'
'editInGridView'
'sync'
'uploadTemplate'
'addTemplate'
'openInOfficeOnline'
'openInOfficeClient'
'addShortcut'
'pinToQuickAccess'
'unpinFromQuickAccess'

Demo

key即需要修改的按钮;postion即排在第几个,用来修改按钮顺序;sectionType表示放在第一排(primary)还是放到ellipsis按钮下(overflow)
{
  "commandBarProps" : {
    "commands": [
      {
        "key": "new",
        "position": 2
      },
       {
        "key": "share",
        "position": 1,
        "sectionType": "Overflow"
      },
      {
        "key": "alertMe",
        "position": 3,
        "sectionType": "Primary"
      }
    ]
  }
}
new按钮放到第二个,alertme按钮放到第三个,share按钮放到ellipsis按钮下第一个

文档地址:https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值