Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use classes in .js file in OpenERP/Odoo ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 143
    Comment on it

    In object-oriented languages, javascript does not build in classes although it provides equivalent (if lower-level mechanisms.
    For simplicity and developer-friendliness Odoo web provides a class system based on John Resig's Simple JavaScript Inheritance.
    New classes are defined by calling the extend() method of openerp.web.Class() For example code is below.

    var MyClass = instance.web.Class.extend({
        say_hello: function() {
            console.log("hello");
        },
    })

    Note- In javasript New classes are defined by calling the extend() method of openerp.web.Class().

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: