Some custom js level checks would be required.
$col["editrules"] = array("readonly"=>true, "readonly-when"=>"check_value");
In html, script tag: this will make field readonly when client_id in 3,6,7,8,9. Similarly you can compare it with your fields.
// readonly conditional function – when return true, field will be readonly
function check_value(formid)
{
client_id = jQuery("input[name=client_id]:last, select[name=client_id]:last",formid).val();
client_id = parseInt(client_id);
if (jQuery.inArray(client_id,[3,6,7,8,9]) != -1)
return true;
}
function chpo()
{
freproductid = jQuery("input[name=freproductid]:last, select[name=freproductid]:last",formid).val();
freproductid = parseInt(freproductid);
productid = jQuery("input[name=eproductid]:last, select[name=productid]:last",formid).val();
freproductid = parseInt(freproductid);
productid = parseInt(productid);
if (jQuery(productid)==jQuery(freproductid))
return true;
//if (jQuery('#freproductid',form).val() == jQuery('#productid',form).val()) jQuery('#freeqty',form).hide(); else jQuery('#freeqty',form).show() }";
}
i used like this but the field is not set read only
$col = array();
$col["title"] = "Free Qty"; // caption of column
$col["name"] = "freeqty";
$col["width"] = "100";
$col["editable"] = true;
$col["isnum"] = true;
$col["isnull"] = true;
$col["editrules"] = array("readonly"=>true, "readonly-when"=>"chpo");
$col["formoptions"] = array("rowpos"=>"3", "colpos"=>"1");
//$col["editoptions"] = array("tabindex"=>"102");
$cols[] = $col;
I've sent the working demo code. Rest is your application logical work and it is outside the scope of phpgrid.
You can put alert statements to debug inside function.
Sir
you may be correct that it MAY out side of the scope BUT I AM USING PHP GRID FOR MY PROJECT ANT IT IS PURCHASED ONE.YOU ARE SAYING THAT YOU CANNOT HELP ME OUT TO SOLVE THE ISSUE.I CAN VERY WELL USE NORMAL PHP.THERE I CAN WRITE THE FUNCTION AND CALL AS I WISH.
THE EXAMPLE THAT YOU GAVE IS NOT WORKING IT SHOWS BLANK PAGE
JUST GIVE SOME SOLUTION IT IS JUST A SIMPLE PAGE WITH TWO DOPDOWN IF TWO IDS ARE EQUAL THE THIRD COLUMN SHOULD NOT BE VISIBLE
Hello,
May be there is some understanding issue. If you can send your code, screenshot of current and screenshot expected result then i can point out the issue OR make a new demo for your case.
Beside this, i don't have your working project + database. So all changes i suggest in your code is just for idea.
You will need to run/debug in your complete project.
You can email me at [email protected]