Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7137 Lượt xem

I am trying to customize some QWeb reports and have seen the use of "widget" in multiple places.

e.g. In /web/static/src/xml/base.xml, the following are used:

<t t-foreach="widget.sections" t-as="section">

widget.items[1].length

widget.options

I understand that these attributes have probably been defined in the JS files. But how do I add a new variable which can be used as a property of widget? I tried assigning "this.new_var=new_var", in JS, but I was unable to access it in qweb. Also, is there any way of displaying all the properties of widget (similar to console.log(self) in JS) ?

 

 

Ảnh đại diện
Huỷ bỏ
Tác giả

One way to obtain the list of widgets is through:

Tác giả Câu trả lời hay nhất

Ok, one way to obtain the list is through:

<t t-log="widget" />

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 12 16
17249
1
thg 4 25
1283
2
thg 3 25
1462
4
thg 11 24
7137
1
thg 3 24
2072