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.

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

报告相同问题?

悬赏问题

  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口