As i am using JQGrid in my project and want to show the column in green color when current date is between start date and end date. If the start date and end date is not between current date then it will display in red color.
So, for that how i write here.
In conditional formatting, example is showing that it will select whole row if i specify
$f = array();
$f["column"] = "name"; // exact column name, as defined above in set_columns or sql field name
$f["op"] = "cn"; // cn – contains, eq – equals
$f["value"] = "Ana";
$f["css"] = "'background-color':'Bisque'"; // must use (single quote ') with css attr and value
$f_conditions[] = $f;
and if i donot select column and op value then it will select whole column.
How to select any particular column?
Thanks for the reply.
Hello sir,
The solution you sent that i already mentioned in my mail. I know how to put conditional formatting on whole row or whole column. I want to put on any particular cell inside the JQGrid.
Explanation:-
Suppose if current date comes between the start date and end date then only start_date, and end_date cell [not whole column] will come in green color if not then both cell [not whole column] will display in red color.
Waiting for your reply.
Thanks & Regards
Gandharv
how to create a condition where READONLY when 2nd field is < value of 10 but EDITABLE and REQUIRED when 2nd field is > value of 10!
tried using example of demos/appreaence/conditional-format.php
but not working.
any assitance would be appreciated.
I've updated the lib, that now support it.
$col["editrules"] = array("required"=>true, "readonly"=>true, "readonly-when"=>array("client_id",">","8"));
Emailing you latest files.
got the latest build…thank u.
question:
what am i doing wrong?
====================
2 fields below:
====================
$col = array();
$col["title"] = "Contract Worth";
$col["name"] = "contract_Worth";
$col["editable"] = true;
$col["editrules"] = array("currency" => true, "required" => false);
$col["editoptions"] = array("size" => 15); //1,000,000,000,000.00
$col["formatter"] = "currency";
$col["formatoptions"] = array("prefix" => "$", "suffix" => '', "thousandsSeparator" => ",", "decimalSeparator" => ".", "decimalPlaces" => '2');
$cols[] = $col;
$col = array();
$col["title"] = "Commission Date";
$col["name"] = "contract_CommissionDate";
$col["editrules"] = array("required"=>true, "readonly"=>true, "readonly-when"=>array("contract_Worth",">","150000"));
$col["formatter"] = "date";
$col["formatoptions"] = array("srcformat"=>'Y-m-d',"newformat"=>'m/d/Y', "opts" => array("changeYear" => false,"showOn"=>"none"));
$cols[] = $col;
After your requirement, I just added a callback function with readonly-when.
Emailing you the updated build and demo.
it is a very good new feature !!
any possibilities to pass array of resitricted value or separate with commas ?
$col["editrules"] = array("required"=>true, "readonly"=> true,"readonly-when"=>array("client_id","==","18,3,4,9"));