简体   繁体   中英

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

For example when in any row n cell nR == nT i want to make them red colors

$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'] ?? 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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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