Hi Abu
Is there an easy way to hide the Primary Key field (“id”) in DB Table Grid php. “SELECT ALL” defaults to select all fields.
thanks
Tony
You can edit code and around line 81, set:
$grid[“hidefirst”] = true;
$g->set_options($grid);
hidefirst hides first column which is usually PK of table. It might work for your case.
Thanks Abu but nothing changes. The primary key is still shown unfortunately.
thanks
Tony
Thanks Abu but nothing changes. The primary key is still shown unfortunately. thanks Tony
You can use hidden=true :
$col = array();
$col[“title”] = “Id”;
$col[“name”] = “id”;
$col[“hidden”] = true;
$cols[] = $col;
$g->set_columns($cols);
$out = $g->render(“list1”);
You can use this updated code:
https://gist.github.com/gridphp/60aa1b04dfa4758c14fff92d8f7e068f
It now contains global variable to control first column display.