通过 JavaScript 访问 Magento Admin Grid 的对象

2022-01-18 00:00:00 grid magento javascript adminhtml

我想访问 Magento Adminhtml Grid 的 JavaScript 对象.我想在我的对话框关闭并且对控制器的 Ajax 请求完成后重新加载网格.

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.

如果我修改 grid.js,这很容易实现.但是我不想修改magento本身的grid.js.

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?

推荐答案

迟到的答案,但也许会对某人有所帮助

Late answer, but maybe it will help someone

如果你像这样在 Grid.php 中设置网格:

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

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

来自javascript,网格对象是

from javascript, grid object is

your_grid_idJsObject

在你的情况下

your_grid_idJsObject.reload();

相关文章