Execute a JS function after a JSReload


Hi there,

this might be a very easy one for JS experts, but after trying around for 2 hours its obvious I need help :slight_smile:

Ok, I have a little JS that resizes a <div> with a certain class to the remaining screen height:

$(document).ready(function () {

window.onresize = function () {

$.fn.fillHeight = function () {
	var siblingsHeight = this.siblings("div.pmg-filter-container").height();
	var height = this.parent().parent().height() - siblingsHeight;

quite simple, works very well after page load and on window resize.
BUT: on some occasions this <div> gets reloaded by a JsReload. Not just this <div> or its content, but a parent div.
When this happens, I need to call fillHeight again to resize the <div> after it has been reloaded. And believe it or not, I am unable to make this happen :slight_smile:
Can you help me? The reload is triggered this way:

//define submit function
$middle_form->onSubmit(function() use ($region) {
	$_SESSION[SMN]['id'] = $region['id'];
	return (new \atk4\ui\jQuery('.eoo-reload-all'))->trigger('eoo-reload-all');


$all_content->addClass('eoo-reload-all')->on('eoo-reload-all', new \atk4\ui\jsReload($all_content));

Thanks for your help!


you can execute multiple actions by adding them into array, but in this case you need action to be triggered when reload is completed (loading time and all) and after all objects inside loaded area have been initialized.

Iā€™m not sure if such functionality exist yet, but it would make sense to have it:



the solution is awfully simple: If I add the JS to an element that gets reloaded, it works:

//everytime the lister gets reloaded, perform JS to set it to the remaining screen height
$lcl->js(true, (new atk4\ui\JsExpression('$(".pmg-lister").height($(".pmg-leftcolumn-container").height() - $(".pmg-filter-container").height())')));

Best regards


oh right :slight_smile: you can even add a GET argument for a trigger.