EasyUI Forum

General Category => EasyUI for React => Topic started by: chrwei on June 23, 2022, 01:57:13 PM



Title: DataList doens't seem to have a double click event?
Post by: chrwei on June 23, 2022, 01:57:13 PM
How might I implement this?


Title: Re: DataList doens't seem to have a double click event?
Post by: jarry on June 27, 2022, 03:33:58 PM
Please look at this example.

Code:
handleDoubleClick(row){
  console.log(row)
}
renderItem({ row }) {
  return (
    <div className="product f-row" onDoubleClick={this.handleDoubleClick.bind(this,row)}>
      <img src={this.getImage(row)} />
      <div className="detail">
        <p>{row.itemid} - {row.name}</p>
        <p>{row.attr}</p>
        <p>List Price: {row.listprice}</p>
      </div>
    </div>
  )
}
render() {
  return (
    <div>
      <DataList
        style={{ width: 550, height: 250 }}
        renderItem={this.renderItem.bind(this)}
        data={this.state.data}
        selectionMode="single"
        onSelectionChange={this.handleSelectionChange.bind(this)}
      />
    </div>
  );
}