При нажатии на кнопку «Refre sh» ничего не происходит? Теоретически, при нажатии на кнопку она должна очистить все, что находится рядом, с помощью refre sh, я думаю. Код ниже:
ln42-ln44
async onStockRefresh(itemName: string) {
await this.checkStockData(itemName);
}
ln56-ln80
private renderStockTable(stockItems: IStockItem[]) {
return (
<table className='table table-striped table-hover' aria-labelledby="tabelLabel">
<thead>
<tr>
<th>Item Name</th>
<th>Stock Quantity</th>
<th>Stock Adjustment</th>
</tr>
</thead>
<tbody>
{stockItems.map(stockItem =>
<tr key={stockItem.itemName}>
<td>{stockItem.itemName}</td>
<td>{stockItem.quantity}<button className="btn btn-primary" onClick={this.onStockRefresh.bind(this, stockItem.itemName)}>Refresh</button></td>
<td>
<input type="text" placeholder="remove quantity" data-item={stockItem.itemName} onChange={this.onAdjustmentChange.bind(this)} />
<button className="btn btn-primary" onClick={() => this.onStockAdjustment(stockItem.itemName)}>Remove</button>
</td>
</tr>
)}
</tbody>
</table>
);
}
Есть идеи?