0
我想從使用語義UI和React呈現的表格獲取單擊值。我使用不可變列表生成我的行,並且我想要一個可以訪問唯一id值的onclick。當我登錄我試圖在我的回調提取價值,我得到:如何使用Semantic的React Table組件獲取表格行單擊中的數據
'bff3a3e9-489e-0E19-c27b-84c10db2432b' 包裹在td標籤
相關代碼:
handleRowClick = (scen) => {
console.log(Object.keys(scen.target));
console.log(scen.target.);
}
mapScenarios =() => {
return ((scen, i) => {
return(
<Table.Row key = {scen.get('id')} onClick = {this.handleRowClick}>
<Table.Cell
children={scen.get('id') || '(No ID)'}
/>
<Table.Cell
children={scen.get('name') || '(No Name)'}
/>
<Table.Cell
children={scen.get('actions').size === 0 ? 'none' : `${scen.get('actions').size} action(s)`}
/>
</Table.Row>
)
})
}