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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?