over 9 years ago
If you want to widget parents and Children in OpenERP(Odoo) follow the below mentioned code and paste it in your wizard .js file:
- local.HomePage = instance.Widget.extend({
- start: function() {
- var greeting = new local.GreetingsWidget(this);
- greeting.appendTo(this.$el);
- console.log(this.getChildren()[0].$el);
- // will print "div.oe_petstore_greetings" in the console
- },
- });
local.HomePage = instance.Widget.extend({ start: function() { var greeting = new local.GreetingsWidget(this); greeting.appendTo(this.$el); console.log(this.getChildren()[0].$el); // will print "div.oe_petstore_greetings" in the console }, });
Note- The first argument is this, which in that case was a Home-Page instance. This tells the widget being created which other widget is its parent.
0 Comment(s)