Hi,
I have a field (an ID) displayed in the list and not editable. That's fine.
But, I need it to appear in the Add form … it doesn't even if I put "add"=>true in $col["show"] … need help.
$col = array();
$col["title"] = "Code";
$col["name"] = "glf_code";
$col["width"] = "40";
//$col["editable"] = true;
$col["show"] = array("list"=>true, "add"=>true, "edit"=>false, "view"=>true);
$col["editrules"] = array("custom"=>true,
"custom_func"=>"function(val,label){return my_validation(val,label);}");
$cols[] = $col;
Thanks,
You must set $col["editable"] = true; to get this behavior.
It won't show in edit so will not be editable but it is required for add dialog.
Hi Abu,
If I set $col["editable"] = true; the field is shown and editable in the line … I do not want it to be editable in the line.
It is shown in the Add form … that's fine.
It is not shown so not editable in the Edit form … that's also fine.
Thanks,
Hi,
Yes, this … $col["show"]["list"]=false; will remove from listing. I'd like to see it.
For me, this field is a kind of User ID. It can be entered (only in Add form) but once created, it is shown (in the list and in the Form) but not editable.
Is that possible ?
Thanks
Try setting:
$col["editrules"]["readonly"] = true;
If your column is not autoincrement, you need to ste autoid = false for first column so it may
get inesrted in insert sql.
Complete column definition would be:
$col = array();
$col["title"] = "Id";
$col["name"] = "client_id";
$col["width"] = "20";
$col["autoid"] = true;
$col["editrules"]["readonly"] = true;
$cols[] = $col;