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

Hi, I want to know how to color a field in the tree view list?

Example: to color in red the field my_field

아바타
취소
작성자

Ok thanks, but in this way, the line will be colored in green or red. I want this: name will be colored in green and status in red for example. Thanks

베스트 답변

hi, for that you can mention a class attribute in your field which you need to change color and in your css file you can add the color or any style for that class, try like this below:

class="red_txt" />

then in css,

.red_txt {

color:red;

}


아바타
취소
베스트 답변

Hi, use the below example code...

In py file

'status' : fields.selection([('single','Single'),('married','Married')],'Status?'),

In xml file

<tree string="Status" colors="red:shop=='single';green:shop=='married' ">

<field name="name"></field>

<field name="status"></field>

</tree>

아바타
취소

This will colour the whole line, not one single field.

관련 게시물 답글 화면 활동
1
3월 15
12271
0
3월 15
4217
3
10월 17
17212
1
3월 15
6466
0
3월 15
7361