Crystal仪表板设计-单击表列锚标记中的操作

时间:2019-06-18 08:02:11

标签: reactjs reactjs-flux reactjs-native

我在reactjs中使用Crystal Dashboard主题,创建了一个表,该表具有通过调用服务来编辑该行数据的操作。但是,当我单击时,每次都会获取最新的数据。这是我的代码段

       <table className="table table-hover table-striped">
        <thead>
          <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Description</th>
            <th>Status</th>
            <th className="text-right">Actions</th>
          </tr>
        </thead>
        <tbody>
          {items.map(item => (
            <tr key={item.industry_Id}>
              <td>{item.industry_Id}</td>
              <td>{item.industry_Name}</td>
              <td>{item.industry_Description}</td>
              <td>{item.active_flag == "1" ? "Active" : "Inactive"}</td>
              <td className="text-right">
                  <a rel="tooltip" id={item.industry_Id}
                  className="btn btn-info btn-simple btn-xs"
                  data-original-title="View Profile"
                  onClick={() => this.setState({ showDelWin: true })}>
                  <i className="fa fa-remove"></i>
                </a>
                <Alert
                  title={item.industry_Name}
                  show={this.state.showDelWin}
                  // showCancelButton={true}
                  showConfirmButton={true}
                  confirmButtonText="Confirm"
                  text="Do you wish to delete the industry"
                  onConfirm={() => this.deleteItem(item)}
                  onOutsideClick={() => this.setState({ showDelWin: false 
                  })}
                  onEscapeKey={() => this.setState({ showDelWin: false 
               })} />
              </td>
            </tr>
          ))}
        </tbody>
      </table>

当我单击第二行操作按钮时,它仅显示最后一行数据

任何人都可以帮忙

0 个答案:

没有答案
相关问题