Hi Cooper,
You can use this custom code to force the page to reload after you submitted the edit action from the edit modal.
Not the best pattern using this (@dcoletta right?) and waiting @artur for a solution but it should work!
Insert this code in the footer - at page level
<script type="text/javascript">
$( window ).on( "load" , function() {
setTimeout(function() {
var buttons = document.getElementsByClassName('modal__btn modal__btn-primary');
var numButtons = buttons.length;
function refresh() {
window.location.reload();
}
for (var i = 0; i < numButtons; i++) {
buttons[i].addEventListener('click', refresh, false);
}
}, 4000);
});
</script>
Following this, I have a question: Is it possible to modify the script to target a specific block using the block ID, instead of refreshing the whole page?
Maybe it won’t be helpful in the future thanks to Softr Dev Team optimizations but taking any suggestions in the meantime.
Thanks!
Hi, does this code work even after updating the new action buttons?
I’m looking for a code that will refresh the page after editing. Because I have a filter in the block whose value changes during editing and the page must be refreshed to display the latest data according to the filter.
I tried, and for some reason the script doesn’t work for me