duanreng3439 2015-11-06 13:24
浏览 59
已采纳

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

I noticed that the Product Catalog, there is an equal housing image to select the store view, it would be very useful in my case, however I do not find how to add this in my GRID.

Store Choose

Could you tell me how to do this? Thank you

@EDIT enter image description here

Just trying to be clearer, when used multistore in catalog_product page is shown a drop down box with all the store, I need to do the same, but on a custom page of my module.

  • 写回答

1条回答 默认 最新

  • douseda0009 2015-11-06 14:03
    关注

    From what I understood you want the drop down box to show the list of all stores. Then you need the source model of adminhtml/system_config_source_store

    This is what you need and/or what you could do. Create a system.xml in the module you created. Add a field to it something like this.

    <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>
    

    The other options is to create your own source model

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

    And then replace the source model path of the system.xml with the one you just created.

    EDIT:

    My Github

    Checkout the commits with message "091115 : Admin Controller Base". Again this is just the base where you could start. You still need to implement the logic for the select to work.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 CST怎么把天线放在座椅环境中并仿真
  • ¥15 任务A:大数据平台搭建(容器环境)怎么做呢?
  • ¥15 r语言神经网络自变量重要性分析
  • ¥15 基于双目测规则物体尺寸
  • ¥15 wegame打不开英雄联盟
  • ¥15 公司的电脑,win10系统自带远程协助,访问家里个人电脑,提示出现内部错误,各种常规的设置都已经尝试,感觉公司对此功能进行了限制(我们是集团公司)
  • ¥15 救!ENVI5.6深度学习初始化模型报错怎么办?
  • ¥30 eclipse开启服务后,网页无法打开
  • ¥30 雷达辐射源信号参考模型
  • ¥15 html+css+js如何实现这样子的效果?