Hello.
How can I hide a column in grid view but show it when inserting/editing a record (it's a password column)?
Also, I need to render a boolean (TINYINT 0: false, -1:true) field as a checkbox. This works fine in editing mode but not in view mode.
Thank you.
To hide column in list, show otherwise, you can set
$col["hidden"] = true;
$col["editrules"] = array("edithidden"=>true);
To display column as checkbox, use
$col["formatter"] = "checkbox";
Thank you, the password setting works great. However, in display mode, the checkbox stays in unchecked state even though the column's value is -1 (true). Is there something like
$col["editoptions"] = array("value"=>"-1:0");
for display mode?
Thanks
Yes, it works for display mode too.
I verified these settings with tinyint and -1:0.
$col = array();
$col["title"] = "Closed";
$col["name"] = "closed";
$col["width"] = "50";
$col["editable"] = true;
$col["edittype"] = "checkbox"; // render as checkbox
$col["editoptions"] = array("value"=>"-1:0"); // with these values "checked_value:unchecked_value"
$col["formatter"] = "checkbox";
$cols[] = $col;