【问题标题】:Primeng datatable cell background color changePrimeng数据表单元格背景颜色变化
【发布时间】:2017-01-06 16:25:29
【问题描述】:

如果用户从下拉列表中更改值,则需要更改 <td> 背景颜色。

<p-column field="newValue" header="User new value" >
    <template let-col let-list="rowData" pTemplate="body">
        // dropdown here
      </template>
</p-column>

【问题讨论】:

    标签: primeng


    【解决方案1】:

    它对我来说很好用。 '#dropdownId' 是动态的。我正在使用 angular2。

    let td = this.element.nativeElement.querySelector('#dropdownId').parentNode.parentNode;
    this.renderer.setElementStyle(td, 'background-color', 'blue');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-08
      • 2011-10-06
      • 2021-09-20
      • 2017-06-19
      • 1970-01-01
      • 2018-06-30
      • 2015-04-03
      • 2022-12-12
      相关资源
      最近更新 更多