简体   繁体   English

如何在 office ui 结构中的详细列表行的 onclick 上打开模式?

[英]How to open modal on onclick of Detail List row in office ui fabric?

I have requirement where I want to open modal on clicking a detail list row.我有要求在单击详细列表行时打开模式。 We are using office ui fabric .我们正在使用office ui fabric

This is detail List这是详细列表

<DetailsList
              items={todos}
              columns={column}
              className={styles.detailList}
              compact={true}
              />

add the columns using state and open the dialog onRender使用 state 添加列并打开对话框 onRender

const [column, setColumn] = useState<IColumn[]>([
    { key: 'column1', name: 'Title', fieldName: 'Title', minWidth: 100, maxWidth: 200, isResizable: false },
    { key: 'column2', name: 'Description', fieldName: 'description', minWidth: 100, maxWidth: 200, isResizable: false },
    { key: 'column4', name: 'Edit', fieldName: 'edit', minWidth: 100, maxWidth: 100, isResizable: false,
        onRender: (item) => (
           <Link onClick={() => toggleHideDialog()}>Edit</Link>
        ),
      },
    { key: 'column5', name: 'Delete', fieldName: 'delete', minWidth: 100, maxWidth: 100, isResizable: false,
        onRender: (item) => (
           <Link onClick={() => { console.log('clicked', item); }}>Delete</Link>
        ),
      },
  ])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 DetailsList - Office UI Fabric - 如何在单击该行的按钮时突出显示该行? - DetailsList - Office UI Fabric - How to highlight a row on a button click of the row? 是否可以在Office UI构造明细列表中包装长标题名称的行? - Is it possible to wrap lines of long header name in office UI fabric Detail List? Office Fluent UI / Fabric UI Modal - 如何从正文组件中关闭它? - Office Fluent UI / Fabric UI Modal - how can I close it from the body component? 如何在 Office UI Fabric React 中设置 dialogDefaultMaxWidth? - How to set dialogDefaultMaxWidth in Office UI Fabric React? 如何将焦点集中在Office UI Fabric的SearchBox中 - How to focus in SearchBox of office ui fabric react 如何验证 office-fabric ui DatePicker - How to validate office-fabric ui DatePicker 带有 Office UI Fabric 的 SPFx - SPFx with Office UI Fabric 如何使用整个行作为切换而不是仅使用小的微小复选框来切换office-ui-fabric细节列表行选择 - How to toggle office-ui-fabric detailslist row selection using the entire row as a toggle instead of just using the small tiny checkbox Office Fabric UI自定义标头 - Office Fabric UI custom headers React:如何在没有刷新页面的情况下使用office UI结构进行导航 - React: how to navigation without refresh page using office UI fabric
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM