如何解决从另一列更新AntD onChange中的列
有没有一种方法可以将onChange的值附加到另一列上?
我正在使用AntD表。一旦触发isEdit
,评分列将具有Select dropdown
,一旦onChange,score
列将更新。
这是我的代码
评级列渲染
const renderColumn = (text,record,index,rowKey,cardKey) => {
if (isEdit && isNaN(text) && rowKey === 'rating') {
return (
<Form.Item>
{getFieldDecorator(`${rowKey}-${cardKey}-${index}`,{
initialValue: text || [],rules: [
{
required: true,message: '*Please fill out this field!',},],})(
<Select
key={index}
style={{ width: '100%' }}
onChange={e => handleRating(e,cardKey)}
>
{ratingOptions.map((obj,i) => (
<Option key={i} value={obj.value}>
{obj.label}
</Option>
))}
</Select>,)}
</Form.Item>
);
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。