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)