Hi,
below code is show a slider in datagrid (thanks for code. I got this code from you)
import React from 'react';
import { DataGrid, GridColumn, Slider } from 'rc-easyui';
class App extends React.Component {
constructor() {
super();
this.state = {
data: [
{ name: 'name1', slider: 50 },
{ name: 'name2', slider: 50 }
]
}
}
render() {
return (
<div>
<DataGrid data={this.state.data} style={{ width: 600, height: 250 }}>
<GridColumn field="name" title="Name" sortable></GridColumn>
<GridColumn field="slider" title="Slider"
render={({ row }) => (
<Slider value={row.slider} onChange={(value) => row.slider = value}></Slider>
)}
/>
</DataGrid>
</div>
);
}
}
export default App;
As you can see both of sliders has same value on startup.
- Now, Please start program
- change 1 slider's value with mouse
- sort with mouse by click header (name column).
you will see both of sliders showing same value.- this error does not occur in subsequent sort clicks. Only in first sort click
And also this bug is not appears when sliders has different value on startup
And also this bug is not appears when you change 2 or more sliders value before sort