如何更改表(SAPUI5)中行的颜色? [英] How to change the color of row in table (SAPUI5)?

查看:333
本文介绍了如何更改表(SAPUI5)中行的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,其中的数据来自后端.根据特定条件(来自后端(网关服务)的数据),如果该条件为true,则该特定行将具有不同的颜色,并将在整个行上具有链接.如果条件为假,那么它将是正常行.

I have a table in which data is coming from back end. Based on particular condition(data coming from back end (gateway service)), if that condition is true then that particular row will have different color and will have a link on full row. And if condition is false then it will be a normal row.

那么如何实现呢?

推荐答案

现在支持行的语义颜色,可以通过使用属性highlight

Semantic colors for rows are now supported which can be leveraged by using the property highlight

  • on ColumnListItem when using sap.m.Table (since 1.44):

<ColumnListItem
  highlight="{= ${odataModel>foo} > 50 ? 'Error' : 'None'}"
> ...

RowSettings上的

  • 使用sap.ui.table.Table(自1.48开始)时:

  • on RowSettings when using sap.ui.table.Table (since 1.48):

    <Table>
      <rowSettingsTemplate>
        <RowSettings highlight="{= ${odataModel>foo} > 50 ? 'Error' : 'None'}"
      </rowSettingsTemplate>
      <columns> ...
    

    • Demo Kit sample Row Highlights
    • Sample with indication colors, available since 1.62: https://jsbin.com/toxehec/edit?html,js,output

    这篇关于如何更改表(SAPUI5)中行的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆