简体   繁体   English

两列相等时将条件格式添加到数据网格

[英]Add Conditional Format to datagrid when equal two columns

I have a table on phpGrid, there is function for adding conditional format on the cells but i need more adaptive option... when in any rows tow defined cells equals each others i want to add format 我在phpGrid上有一张桌子,有在单元格上添加条件格式的功能,但我需要更多自适应选项...当在任何行中,两个定义的单元格彼此相等时,我想添加格式

For example when in any row n cell nR == nT i want to make them red colors 例如,当在任何行中的n个单元格nR == nT时,我想将它们设为红色

$dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders"); 
$dg->set_conditional_format("orderNumber","CELL",array( "condition"=>"eq","value"=>"10107","css"=> array("color"=>"#ffffff","background-color"=>"green"))); 
// that is in documentation and i have tried this 
$dg->set_conditional_format("orderNumber","CELL",array( "condition"=>"eq","value"=>$dg->columns['orderNumber'] ,"css"=> array("color"=>"#ffffff","background-color"=>"green")));

What is $dg->columns['orderNumber'] ?? 什么是$dg->columns['orderNumber'] I could not find it mentioned anywhere in their online documentation . 我找不到他们的在线文档中提到的任何内容

My guess is that you are trying to compare values among columns. 我的猜测是您正在尝试比较各列之间的值。 You can take a look at their OnGridLoadComplete event handler examples: 您可以看一下他们的OnGridLoadComplete事件处理程序示例:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM