Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7128 มุมมอง

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) ?

 

 

อวตาร
ละทิ้ง
ผู้เขียน

One way to obtain the list of widgets is through:

ผู้เขียน คำตอบที่ดีที่สุด

Ok, one way to obtain the list is through:

<t t-log="widget" />

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ธ.ค. 16
17245
1
เม.ย. 25
1280
2
มี.ค. 25
1458
4
พ.ย. 24
7135
1
มี.ค. 24
2066