Hey @intelligroup
I’m going to assume that the button is a form submit button and you want something like this.
After finding the Forms ID, you can use the following JavaScript to refresh all components on the page after submitting a form.
var submitButtonLoaded = false;
var formID = 'x_element_page_X_XX'; // Change this to the ID of the form you are submitting
var timeToWait = 500; // Number of milliseconds to wait before refreshing the tables
function checkIfSubmitButtonHasLoaded() {
if(submitButtonLoaded === false) {
if ($('#'+formID+' .form-submit button').html() !== undefined) {
submitButtonLoaded = true;
}
window.setTimeout(checkIfSubmitButtonHasLoaded, 100);
} else {
$('#'+formID+' .form-submit button').click(function(){
setTimeout(function(){
$('[ng-click="refreshData()"]').click();
},timeToWait);
});
}
}
checkIfSubmitButtonHasLoaded();
Make sure you changed x_element_page_X_XX to the ID of the form. You may need to adjust the number of milliseconds for the timeout depending on how long it takes for your form to be submitted.