跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 开发与实施交流
  4. Openerp WEB 前端开发

Openerp WEB 前端开发

已定时 已固定 已锁定 已移动 Odoo 开发与实施交流
4 帖子 2 发布者 3.9k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • 神 离线
    神 离线
    神仙采葡萄
    写于 最后由 编辑
    #1

    最近在做一个openerp的模块但是由于左侧菜单栏较多,考虑给左侧的菜单栏做一个折叠菜单的小功能,但是没能实现

    看了一下openerp左侧菜单栏的结构是这个样子的:

    <br />&lt;div class=&quot;oe_secondary_menus_container&quot;&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;oe_secondary_menu&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;oe_secondary_menu_section&quot;&gt;...&lt;/div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;ul class=&quot;oe_secondary_submenu&quot;&gt;...&lt;/ul&gt;<br />&nbsp; &nbsp; &lt;/div&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;oe_secondary_menu&quot;&gt;...&lt;/div&gt;<br />&nbsp; &nbsp; &lt;div class=&quot;oe_secondary_menu&quot;&gt;...&lt;/div&gt;<br />...............<br />&lt;/div&gt;<br />
    




    我在/modules/static/src/js/modules.js文件中有如下代码:

    <br />openerp.polling = function(instance) {<br />	var _t = instance.web._t,<br />		_lt = instance.web._lt;<br />	var QWeb = instance.web.qweb;<br /><br />	instance.polling = {};<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; $(function () {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 	var MenuOne = $(&quot;.oe_secondary_menu_section&quot;);<br />		var MenuTwo = $(&quot;.oe_secondary_submenu&quot;);<br />		$(MenuOne).each(function (i) {<br />			$(this).click(function () {<br />				if ($(MenuTwo[i]).css(&quot;display&quot;) == &quot;block&quot;) {<br />					$(MenuTwo[i]).slideUp(300);<br />					$(MenuOneLi[i]).removeClass(&quot;menu-show&quot;)<br />				 } else {<br />					for (var j = 0; j &lt; aMenuTwo.length; j++) {<br />						$(MenuTwo[j]).slideUp(300);<br />						$(MenuOneLi[j]).removeClass(&quot;menu-show&quot;);<br />					}<br />				&nbsp; &nbsp; &nbsp; &nbsp; $(MenuTwo[i]).slideDown(300);<br />					$(MenuOneLi[i]).addClass(&quot;menu-show&quot;)<br /> 				}<br /> 			});<br />		});<br />&nbsp; &nbsp; &nbsp; &nbsp; });<br />}<br />
    




    测试结果不行,但是在oe前段自己做的页面添加一个类似的菜单结构,再用如上方法可以实现折叠菜单的功能。
    请问我这个是不是和oe本身的那啥啥有冲突啊,加上以后左侧菜单会载入的慢一些,不能实现折叠菜单的功能。
    还请有过类似开发经验的大神不吝赐教,谢谢了!

    1 条回复 最后回复
    0
    • mrshellyM 离线
      mrshellyM 离线
      mrshelly
      写于 最后由 编辑
      #2

      现在左侧的菜单不就是折叠的么?

      [attachimg=1]

      [attachimg=2]

      [attachimg=3]


      1 条回复 最后回复
      0
      • 神 离线
        神 离线
        神仙采葡萄
        写于 最后由 编辑
        #3

        [quote author=mrshelly link=topic=16604.msg28963#msg28963 date=1410509466]
        现在左侧的菜单不就是折叠的么?

        [attachimg=1]

        [attachimg=2]

        [attachimg=3]



        [/quote]

        这个好像是三级或分更多级会自动折叠吧,我要的是:如你图上所示点击“You know”折叠他的子菜单
        感谢你的回答。

        1 条回复 最后回复
        0

        • 登录

        • 没有帐号? 注册

        • 登录或注册以进行搜索。
        • 第一个帖子
          最后一个帖子
        0
        • 版块
        • 标签
        • 热门
        • 用户
        • 群组