在网格上创建 Store_view 复选框 - Magento

Create Store_view check box on the grid - Magento

我注意到产品目录中有一个与 select 商店视图相同的房屋图像,这对我来说非常有用,但是我找不到如何在我的 GRID 中添加它。

你能告诉我怎么做吗? 谢谢

@编辑

为了更清楚,当在 catalog_product 页面中使用 multistore 时,会显示一个包含所有商店的下拉框,我需要做同样的事情,但在我的模块的自定义页面上。

据我了解,您希望下拉框显示所有商店的列表。那么你需要adminhtml/system_config_source_store

的源码模型

这就是您需要的and/or您可以做的。在您创建的模块中创建一个 system.xml。像这样向其中添加一个字段。

<store_select translate="label comment">
    <label>Select Store</label>
    <frontend_type>Select</frontend_type>
    <source_model>adminhtml/system_config_source_store</backend_model>
    <sort_order>20</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>
</store_select>

其他选项是创建您自己的源模型

class [Namespace]_[Module]_Model_Store {
   public function toOptionArray() {
       return Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true);
   }
}

然后将 system.xml 的源模型路径替换为您刚刚创建的路径。

编辑:

My Github

检查带有消息“091115:管理控制器基础”的提交。同样,这只是您可以开始的基础。您仍然需要实现 select 工作的逻辑。