[英]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.