跳至內容
選單
此問題已被標幟
1 回覆
7167 瀏覽次數

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" />

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
12月 16
17274
1
4月 25
1302
2
3月 25
1487
4
11月 24
7160
1
3月 24
2095