We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在使用EditableProTable的时候自定义操作栏只返回一个删除按钮时当我提交或重置时为什么无法让表格回到初始化的样子,再次提交或重置时才可以,有没有大佬指点一下
<EditableProTable rowKey="line_id" bordered={true} editableFormRef={editableFormRef} controlled actionRef={actionRef} formItemProps={{ rules: [ { validator: async (_, value) => { if (value.length < 1 || !value[0].product_name) { throw new Error('请至少添加一个商品'); } if (value.length > 5) { throw new Error('最多可以添加5个商品'); } }, }, ], }} maxLength={10} name="goodsList" columns={columns} recordCreatorProps = {false} editable={{ type: 'multiple', editableKeys, onChange: setEditableRowKeys, actionRender: (row, config, defaultDom) => { if(row.product_no) { return [defaultDom.delete]; } return []; }, onDelete:async (key,row)=>setIndex(index-1), }} />
这是提交或重置的样子
The text was updated successfully, but these errors were encountered:
在使用EditableProTable时,你自定义操作栏只返回了一个删除按钮。当你提交或重置表格时,无法让表格回到初始化的样子,需要再次提交或重置才可以。这个问题可能是因为你没有正确处理表格的重置操作。
要解决这个问题,你可以在重置操作时,手动将editableKeys重置为空数组,即setEditableRowKeys([])。这样就可以让表格回到初始化的状态。在提交操作时,你也需要根据实际需求来处理相关的逻辑。
另外,你还提到有很多按钮组,想确定它们的顺序。一般来说,我们会按照以下逻辑来确定按钮的顺序:
希望这些解答能对你有帮助!如果还有其他问题,请随时提问。
Sorry, something went wrong.
No branches or pull requests
🧐 问题描述 | Problem description
在使用EditableProTable的时候自定义操作栏只返回一个删除按钮时当我提交或重置时为什么无法让表格回到初始化的样子,再次提交或重置时才可以,有没有大佬指点一下
💻 示例代码 | Sample code
<EditableProTable
rowKey="line_id"
bordered={true}
editableFormRef={editableFormRef}
controlled
actionRef={actionRef}
formItemProps={{
rules: [
{
validator: async (_, value) => {
if (value.length < 1 || !value[0].product_name) {
throw new Error('请至少添加一个商品');
}
if (value.length > 5) {
throw new Error('最多可以添加5个商品');
}
},
},
],
}}
maxLength={10}
name="goodsList"
columns={columns}
recordCreatorProps = {false}
editable={{
type: 'multiple',
editableKeys,
onChange: setEditableRowKeys,
actionRender: (row, config, defaultDom) => {
if(row.product_no) {
return [defaultDom.delete];
}
return [];
},
onDelete:async (key,row)=>setIndex(index-1),
}}
/>
🚑 其他信息 | Other information
这是提交或重置的样子
The text was updated successfully, but these errors were encountered: