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

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 15
12230
0
มี.ค. 15
4173
3
ต.ค. 17
17186
1
มี.ค. 15
6425
0
มี.ค. 15
7325