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

Here is the dummy code what i am trying to do to achieve something, please check what i want for <p> attribute value during runtime. I dont want the value should be render from python variable.

<t t-foreach="[1,2]" t-as="row_value">

    <div class="row">

        <t t-foreach="[1, 2, 3]" t-as="column_value">

            <p t-attf-id="paragraph_id_{{ row_value * column_value }}"/></p>

        </t>

    </div>

</t>
Here is what i want to render the id value of <p> tag atttibute.
<p id=paragraph_id_1></p>

<p id=paragraph_id_2></p>  

 <p id=paragraph_id_3></p>

<p id=paragraph_id_4></p>

<p id=paragraph_id_5></p>

<p id=paragraph_id_6></p>  

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Try this,


<p t-att-id="'paragraph_id_' +  row_value * column_value "/></p>


Kind regards,

Reda


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 21
4675
1
มี.ค. 24
4752
1
มิ.ย. 18
5810
1
ส.ค. 15
10249
1
พ.ค. 23
9745