|
tree视图中根据一些条件设置具体的颜色 。例如:具体颜色取决于其状态。
- <tree string=”session List”
- colors=”blue:state==’draft'; green:state==’confirmed’ “>
- <field name=”name”/>
- <field name=”start_date”/>
- <field name=”end_date”/>
- <field name=”duration”/>
- <field name=”seats”/>
- <field name=”instructor_id”/>
- <field name=”course_id”/>
- <field name=”attendee_count”/>
- <field name=”state” />
- <field name=”taken_seats” widget=”progressbar”/>
- </tree>
复制代码 不要忘记,字段列表中各条件的属性的设置 ,其中就包含颜色属性。- If state in either ‘confirmed’, ‘done’, ‘waiting’ :
- colors=”blue: state in (‘confirmed’, ‘done’, ‘waiting’)”
- if state is equal to ‘draft’:
- colors=”blue: state==’draft’ “
- if duration is greater than 5:
- colors=”blue: duration > 5 “
- if duration is less than 15:
- colors=”blue: duration < 15 “
- multiple conditions:
- colors=”blue: state in (‘confirmed’, ‘done’, ‘waiting’) ; red: state==’draft’”
-
复制代码 字体
我们也可以通过设置属性的方式,进行字体的设置。例如
- fonts=”bold:message_unread==True”设置粗体
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|