콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
6040 화면

-  I want to skip the current iteration of the loop with continue in XML foreach ?

아바타
취소
베스트 답변

Mostafa,

I don't think there is way to skip the loop, alternatively what u can do is, keep "if condition" to do your operation if particular condition matches, for eg:

to print div if your boolean value is true and skip if false, you can use:

<t t-foreach="<list_of_obj>" t-as="obj">

     <t t-if="obj.<bool_field>" ><!-- checking if field is True *-->

         <div>  Created when field is True</div>

     </t>

     <!-- No div will be created in 'false' case -->

</t>


Hope it helps!!

아바타
취소
작성자

Dear Pawan.

I find a way out by setting flags using t-set tag and t-value

Thank you for your support !

관련 게시물 답글 화면 활동
2
8월 23
12788
1
3월 25
1182
0
11월 24
1425
0
6월 24
1489
1
6월 24
1966