我在我的模块中创建了一个自定义选项卡并成功显示了一个网格输出,但我的问题是我们如何在一页中显示两个网格序列化程序块?我试图用这段代码调用两个序列化程序块。
public function customgridAction()
{
$this->loadLayout();
$this->getLayout()->getBlock('regionpage.productgrid')->setProductsGrid($this->getRequest()->getPost('products_grid', null));
$this->getLayout()->getBlock('regionpage.articlegrid')->setArticlesGrid($this->getRequest()->getPost('articles_grid', null));
$this->renderLayout();
}
这就是我的布局 xml 的样子
<regionpage_adminhtml_regionpage_customgrid>
<block type="core/text_list" name="root">
<block type="regionpage/adminhtml_regionpage_edit_tab_productgrid" name="regionpage.productgrid"/>
<block type="adminhtml/widget_grid_serializer" name="regionpage_productgrid">
<reference name="regionpage_productgrid">
<action method="initSerializerBlock">
<grid_block_name>regionpage.productgrid</grid_block_name>
<data_callback>getSelectedProducts</data_callback>
<hidden_input_name>links[productgrid]</hidden_input_name>
<reload_param_name>products_grid</reload_param_name>
</action>
<action method="addColumnInputName">
<input_name>position</input_name>
</action>
</reference>
</block>
</block>
<regionpage_adminhtml_regionpage_customgrid>
<block type="core/text_list" name="root">
<block type="regionpage/adminhtml_regionpage_edit_tab_articlegrid" name="regionpage.articlegrid"/>
<block type="adminhtml/widget_grid_serializer" name="regionpage_articlegrid">
<reference name="regionpage_articlegrid">
<action method="initSerializerBlock">
<grid_block_name>regionpage.articlegrid</grid_block_name>
<data_callback>getSelectedArticles</data_callback>
<hidden_input_name>links[articlegrid]</hidden_input_name>
<reload_param_name>articles_grid</reload_param_name>
</action>
<action method="addColumnInputName">
<input_name>position</input_name>
</action>
</reference>
</block>
</block>
</regionpage_adminhtml_regionpage_customgrid>
但它输出最后一个块而不是两个块。