Reload grid and view after pop up is closed


#1

Good afternoon,
I have a page with grid and view. From these page I can open pop up window, but I want to reload grid and view after pop up is closed. Grid can reload like this:

page:

$grid = $this -> add('Grid');
$this -> js('reload_grid',$grid -> js() -> relaod());

pop up:

$form -> js('click') -> univ() -> closeDialog() -> getjQuery() -> trigger('reload_grid') -> execute();

How can I now reload grid and view together after pop up is closed?

Thank you in advance


#2

i reformatted your code a little, but looks like some syntax errors are still there (relaod())

My suggestion is to add a class to your main page called do-reload for all the elements which will need reloading:

$grid->addClass('do-reload')->js('reload')->reload();
$view->addClass('do-reload')->js('reload')->reload();

Then you simply need to do:

$this->js()->_selector('.do-reload')->trigger('reload')->execute();

When you close your dialog.

P.S. You can use “close” event of the jQuery Dialog through an option to trigger.