1

I would like to access the JavaScript Object of the Magento Adminhtml Grid. I want to reload the Grid after my Dialog is closed an the Ajax-Request to the Controller has finished.

If i modify the grid.js this is easy to make. But i don't want to modify the grid.js of magento itself.

Any ideas how i can access that object?

Manuel Richarz
  • 1,916
  • 13
  • 27

2 Answers2

4

Late answer, but maybe it will help someone

If you setup the grid in Grid.php like this:

parent::__construct();
$this->setId('your_grid_id');
.
.
.

from javascript, grid object is

your_grid_idJsObject

in your case

your_grid_idJsObject.reload();
Ionut A
  • 101
  • 1
  • 5
-1

You can update your layout by this

<action method="addJs"><script>somepath/somefile.js</script></action>

For example, I needed to add javascript to sales->order grid.

<adminhtml_sales_order_index>
   <reference name="head">
      <action method="addJs"><script>somepath/somefile.js</script></action>
   </reference>
</adminhtml_sales_order_index>

js/somepath/somefile.js - this is path for file. Hope this help.