繁体   English   中英

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

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

我在phpGrid上有一张桌子,有在单元格上添加条件格式的功能,但我需要更多自适应选项...当在任何行中,两个定义的单元格彼此相等时,我想添加格式

例如,当在任何行中的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")));

什么是$dg->columns['orderNumber'] 我找不到他们的在线文档中提到的任何内容

我的猜测是您正在尝试比较各列之间的值。 您可以看一下他们的OnGridLoadComplete事件处理程序示例:

暂无
暂无

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

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