diff --git a/docs/zh-CN/components/table2.md b/docs/zh-CN/components/table2.md index f43e42b57..cccb257bd 100755 --- a/docs/zh-CN/components/table2.md +++ b/docs/zh-CN/components/table2.md @@ -3558,6 +3558,7 @@ order: 67 "body": { "type": "service", "api": "/api/sample?perPage=5", + "id": "service-container", "body": [ { "type": "table2", @@ -3566,6 +3567,25 @@ order: 67 "url": "/api/mock2/sample/bulkUpdate", "method": "put" }, + "draggable": true, + "onEvent": { + "quickSaveSubmitted": { + "actions": [ + { + "actionType": "reload", + "componentId": "service-container" + } + ] + }, + "orderChange": { + "actions": [ + { + "actionType": "reload", + "componentId": "service-container" + } + ] + } + }, "columns": [ { "title": "Engine", diff --git a/packages/amis/src/renderers/Table2/index.tsx b/packages/amis/src/renderers/Table2/index.tsx index fb4aade88..9f66b3f5a 100644 --- a/packages/amis/src/renderers/Table2/index.tsx +++ b/packages/amis/src/renderers/Table2/index.tsx @@ -1424,7 +1424,8 @@ export default class Table2 extends React.Component { keyField, env, messages, - reload + reload, + dispatchEvent } = this.props; if (Array.isArray(rows)) { @@ -1454,6 +1455,7 @@ export default class Table2 extends React.Component { errorMessage: messages && messages.saveSuccess }) .then(() => { + dispatchEvent('quickSaveSubmitted', data); reload && this.reloadTarget(filterTarget(reload, data), data); }) .catch(() => {}); @@ -1473,6 +1475,7 @@ export default class Table2 extends React.Component { store .saveRemote(quickSaveItemApi, sendData) .then(() => { + dispatchEvent('quickSaveSubmitted', sendData); reload && this.reloadTarget(filterTarget(reload, data), data); }) .catch(() => {