在模态中的reactjs中单击“视图”按钮时从表数据传递数据

时间:2018-10-29 15:22:48

标签: reactjs

我有一个包含数据的表,当在reactJs应用程序中单击特定项目的“查看”按钮时,我需要将特定项目的数据传递给模式。

{this.state.employees.map(employee =>

                                        <tr>
                                            <td>1</td>
                                            <td>{employee.firstName}</td>
                                            <td>{employee.lastName}</td>
                                            <td>{employee.department.name}</td>
                                            <td>{employee.role}</td>
                                            <td>{employee.date_of_resumption}</td>                                  
                                            <td><label class="switch">
                                                    <input type="checkbox"/>
                                                    <span class="slider round"></span>
                                                </label>
                                            </td>
                                            <td>

                                                <button type="submit"  data-toggle="modal" data-placement="right" data-target="#customer_detail" style={{ border: '0', backgroundColor: 'white'}}><span class="view"><img src="imgs/icons/view.png" data-toggle="tooltip" data-placement="left" title="View"/></span></button>

0 个答案:

没有答案
相关问题