Skip to content

Instantly share code, notes, and snippets.

@tmoore88
Created March 9, 2022 19:50
Show Gist options
  • Save tmoore88/37586037e55ec0eafe952b6eb8e67a42 to your computer and use it in GitHub Desktop.
Save tmoore88/37586037e55ec0eafe952b6eb8e67a42 to your computer and use it in GitHub Desktop.
$col = array();
$col["title"] = "CWP";
$col["name"] = "ck_prod_cop";
$col["editable"] = true;
$col["edittype"] = "checkbox";
$col["formatter"] = "checkbox";
$col["editoptions"] = array("value"=>"0:1");
$col["hidden"] = false;
$col["width"] = "35";
$col["export"] = false;
$col["search"] = false;
$cols[] = $col;
$col = array();
$col["title"] = "Status";
$col["name"] = "unit_closed";
$col["width"] = "30";
$col["editable"] = true;
$col["edittype"] = "select";
$str = "O:O;C:C";
$col["editoptions"] = array("value"=>$str);
$col["export"] = false;
$col["search"] = false;
$col["editrules"] = array("required"=>false, "readonly"=>true, "readonly-when"=>"check_po");
$cols[] = $col;
<script>
function check_po(formid)
{
ck_prod_cop = jQuery("input[name=ck_prod_cop]:last, select[name=ck_prod_cop]:last",formid).val();
if (ck_prod_cop != 1)
{
return true
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment