Skip to content
  • Categories
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • 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

  • Default (Flatly)
  • No Skin
Collapse

Odoo 中文社区

  1. Home
  2. Categories
  3. Odoo 开发与实施交流
  4. 怎么看不懂odoo里的js写法呢?

怎么看不懂odoo里的js写法呢?

Scheduled Pinned Locked Moved Odoo 开发与实施交流
10 Posts 4 Posters 5.8k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kl
    wrote on last edited by
    #1

    回复: Js初探

    看的脑袋疼。
    和网页上正常的写法有什么不同吗?

    请求指教,感谢。。。

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Siyuan
      wrote on last edited by
      #2

      没有什么不同,

      继承重写用 include,

      继承复制用 extend

      K 1 Reply Last reply
      1
      • 鲍 Offline
        鲍 Offline
        鲍永道
        wrote on last edited by
        #3

        可以去看下backbone.js和underscore.js,最底层的就是这两个js了。你了解下,应该对odoo前端js会有所理解的。

        1 Reply Last reply
        1
        • S Siyuan

          没有什么不同,

          继承重写用 include,

          继承复制用 extend

          K Offline
          K Offline
          kl
          wrote on last edited by
          #4

          @siyuan 感谢指导

          1 Reply Last reply
          0
          • 静 Offline
            静 Offline
            静静
            wrote on last edited by
            #5

            odoo前端是自己实现的框架,刚开始不用看懂,只用参照他的例子学习一下,就行了。熟练了再去学习他的原理

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kl
              wrote on last edited by
              #6

              再请教一个问题:odoo theme教程里这段js
              //开始

              (function() {
              'use strict';
              var website = odoo.website;
              website.odoo_website = {};

              website.snippet.options.snippet_testimonial_options = website.snippet.Option.extend({
                  onFocus: function() {
                      alert("On focus!");
                  }
              })
              

              })();

              //结束

              完全照着做的,却怎么也不运行?
              而且这段js在浏览器里报错。
              请教可知道是什么原因?感谢

              鲍 2 Replies Last reply
              0
              • K kl

                再请教一个问题:odoo theme教程里这段js
                //开始

                (function() {
                'use strict';
                var website = odoo.website;
                website.odoo_website = {};

                website.snippet.options.snippet_testimonial_options = website.snippet.Option.extend({
                    onFocus: function() {
                        alert("On focus!");
                    }
                })
                

                })();

                //结束

                完全照着做的,却怎么也不运行?
                而且这段js在浏览器里报错。
                请教可知道是什么原因?感谢

                鲍 Offline
                鲍 Offline
                鲍永道
                wrote on last edited by
                #7

                @kl写法错误,odoo里面的扩展哪里是这样写的。

                1 Reply Last reply
                0
                • K kl

                  再请教一个问题:odoo theme教程里这段js
                  //开始

                  (function() {
                  'use strict';
                  var website = odoo.website;
                  website.odoo_website = {};

                  website.snippet.options.snippet_testimonial_options = website.snippet.Option.extend({
                      onFocus: function() {
                          alert("On focus!");
                      }
                  })
                  

                  })();

                  //结束

                  完全照着做的,却怎么也不运行?
                  而且这段js在浏览器里报错。
                  请教可知道是什么原因?感谢

                  鲍 Offline
                  鲍 Offline
                  鲍永道
                  wrote on last edited by
                  #8

                  @kl

                  odoo.define('web.taony_menu_scroll', function (require) {
                      "use strict";
                  
                  //里面在进行扩展或是继承
                  }
                  
                  K 1 Reply Last reply
                  0
                  • 鲍 鲍永道

                    @kl

                    odoo.define('web.taony_menu_scroll', function (require) {
                        "use strict";
                    
                    //里面在进行扩展或是继承
                    }
                    
                    K Offline
                    K Offline
                    kl
                    wrote on last edited by
                    #9

                    @鲍永道 多谢大侠再次指点。

                    鲍 1 Reply Last reply
                    0
                    • K kl

                      @鲍永道 多谢大侠再次指点。

                      鲍 Offline
                      鲍 Offline
                      鲍永道
                      wrote on last edited by
                      #10

                      @kl 不用客气,多多交流。

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Tags
                      • Popular
                      • Users
                      • Groups