-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
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
WIP: sends table widget data on each ajax form submit #560
base: develop
Are you sure you want to change the base?
Conversation
Instead of sending data of a table widget only on a certain ajax handler (default `onSave`) the table widget now sends data on every ajax form submit.
This PR yet does not contain the newly compiled JS files. |
This pull request will be closed and archived in 3 days, as there has been no activity in this pull request for the last 6 months. |
@LukeTowers Is this PR still "required" or desired to be merged? |
It is, but right now my priorities are on the marketplace. I will circle back to this when I have time. |
@der-On @bennothommo what's the status of this PR? |
The PR works as described, however, it might be considered a BC break for the table widget behavior since now the table data is included with every AJAX request, not just the specified AJAX event. I also think it will cause some issues for the Builder plugin, mainly on pages where there are other AJAX actions on the page besides the saving of data. I'd be inclined to block this PR for the moment until we can ensure that the Builder plugin won't be affected. |
@der-On are you interested in testing this change with the builder plugin so that we can move forward with merging it? |
@LukeTowers I will try. Please assign it to me, so I do not loose it. |
@bennothommo I've tried to test the builder, but that one seems broken currently.
|
@der-On what's the context? Which table? |
@bennothommo I've opened the main page of the builder plugin, created a Test plugin using it and after that I get this error. I get the same error when clicking on the button to show me the existing plugins. At this point this PR was not merged. |
I will retest it again with current dev versions as this is pretty urgent for us. |
@bennothommo I get the same result with current dev-main version of the builder. The builder plugin seems to be partly broken in it's current state. I however was able to add tables and columns using the builder plugin with this PR applied. |
This comment was marked as outdated.
This comment was marked as outdated.
@der-On have you tested this with a fresh install of Winter and the Builder plugin, with just your PR's changes applied? |
@bennothommo Will try with fresh winter without translate plugin. |
@der-On any updates on this? |
@LukeTowers @bennothommo I've now found the time to test it against a fresh install of winter with dev-develop and builder plugin on dev-main. Builder seems to work but when creating model list definition I get the following error with my change:
Will investigate on this to find a workaround. |
@bennothommo @LukeTowers I found a solution with a small fix to the PR and the builder. I've also edited the PR description to better describe the problem. If no postbackHandlerName is set on a datatable it will update on each ajax request. However if a postbackHandlerName is defined on the table widget it will only update on that. In the builder plugin I needed to add the following to
|
Instead of sending data of a table widget only on a certain ajax handler (default
onSave
) the table widget now sends data on every ajax form submit.What problem does this PR solve?
When having a translatable datatable widget data get's lost when switching locales.
In this example I show the current behaviour:
formProperties::onSwitchItemLocale
is send, however the table will only handle theonSave
handler by default:How does this PR solve the problem?
By handling any ajax request handler the form data is preserved for each locale.
However this means datatables that are within forms that also allow other ajax handlers and must not handle those a specifique
postbackHandlerName
must now be added to the field config of the datatable to only listen to those ajax requests.