link colum not showing on grid

Questionslink colum not showing on grid
jiga asked 2 years ago

Hi, im trying to display a virtual link column to do some operations, but column is not showing, i can make dbfields as links but I need a virtual column how can I do that? This is my code:

$col = array();
$col[“title”] = “ID”;
$col[“name”] = “id”;
$col[“width”] = “40”;
$col[“align”] = “center”;
$col[“editable”] = false;
$col[“hidden”] = true;
$cols[] = $col;

$col = array();
$col[“title”] = “<i class=’fas fa-building’></i> GRUPO”;
$col[“name”] = “grupo”;
$col[“width”] = “40”;
$col[“align”] = “center”;
$col[“editable”] = false;
$col[“resizable”] = false;
$cols[] = $col;

$col = array();
$col[“title”] = “<i class=’fas fa-pencil-alt’></i> NOMBRE”;
$col[“name”] = “nombre”;
$col[“width”] = “40”;
$col[“align”] = “center”;
$col[“editable”] = false;
$col[“resizable”] = true;
$cols[] = $col;

$col = array();
$col[“title”] = “<i class=’fas fa-file-alt’></i> CURP”;
$col[“name”] = “curp”;
$col[“width”] = “40”;
$col[“align”] = “center”;
$col[“editable”] = false;
$col[“resizable”] = true;
$cols[] = $col;

$col = array();
$col[“title”] = “Action”;
$col[“name”] = “id”;
$col[“link”] = “clientreg.php?id={id}”;
$col[“linkoptions”] = “target=’_self'”;
$col[“width”] = 25;
$col[“editable”] = false;
$col[“search”] = false;
$cols[] = $col;

$grid[“rowList”] = array(10,20,30,40,50,’All’);
$grid[“autowidth”] = false;
$grid[“sortable”] = true;
$grid[“rowNum”] = 16;
$grid[“rownumbers”] = true;
$grid[“rownumWidth”] = 30;
$grid[“forceFit”] = true;
$grid[“shrinkToFit”] = true;
$grid[“resizable”] = true;
$grid[“autoresize”] = true;
$grid[“multiselect”] = false;
$grid[“altRows”] = true;
$grid[“cellEdit”] = false;
$grid[“reloadedit”] = true;
$grid[“caption”] = “<i class=’fas fa-envelope’></i> CONTROL ESCOLAR – SOLICITUD DE CURP”;
$grid[“loadtext”] = “<i class=’fa fa-spinner fa-2x fa-spin’></i> Buscando coindicencias …”;
$grid[“sortorder”] = “desc”;
$grid[“add_options”][“jqModal”] = true;
$grid[“add_options”][“modal”] = true;
$grid[“edit_options”][“jqModal”] = true;
$grid[“edit_options”][“modal”] = true;
$grid[“edit_options”][“checkOnSubmit”] = true;
$grid[“add_options”][“success_msg”] = “<i class=’fa fa-check’></i> Registro agregado exitosamente”;
$grid[“edit_options”][“success_msg”] = “<i class=’fa fa-check’></i> Registro modificado exitosamente”;
$grid[“delete_options”][“success_msg”] = “<i class=’fa fa-check’></i> Registro eliminado exitosamente”;

$g->select_command = “SELECT id,grupo,nombre,curp FROM buho3448_econ.alumnos”.$ciclo_anos;
$g->table = “buho3448_econ.alumnos”.$ciclo_anos;
$out = $g->render(“list1”);
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “”&gt;
<script src=””></script&gt;
<link rel=”stylesheet” href=”; integrity=”sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm” crossorigin=”anonymous”>
<script src=”; integrity=”sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl” crossorigin=”anonymous”></script>
<script src=”; integrity=”sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q” crossorigin=”anonymous”></script>
<script defer src=”; integrity=”sha384-SlE991lGASHoBfWbelyBPLsUlwY1GwNDJo3jSJO04KZ33K2bwfV9YBauFfnzvynJ” crossorigin=”anonymous”></script>
<link href=”css/escuela.css” media=”screen” rel=”stylesheet” type=”text/css” /> 
<link rel=”stylesheet” type=”text/css” media=”screen” href=”lib/js/themes/dot-luv/jquery-ui.custom.css”></link> 
<link rel=”stylesheet” type=”text/css” media=”screen” href=”lib/js/jqgrid/css/ui.jqgrid.css”></link>    
    <script src=”lib/js/jquery.min.js” type=”text/javascript”></script>
    <script src=”lib/js/jqgrid/js/i18n/grid.locale-en.js” type=”text/javascript”></script>
    <script src=”lib/js/jqgrid/js/jquery.jqGrid.min.js” type=”text/javascript”></script>    
    <script src=”lib/js/themes/jquery-ui.custom.min.js” type=”text/javascript”></script>

1 Answers
Abu Ghufran Staff answered 2 years ago

It looks like you are using older version of library.
You can try adding all columns manually are remove the second param ‘true’ from set_column.
$g->set_columns($cols,true); >>> $g->set_columns($cols);

Abu Ghufran - Dev Team
Grid 4 PHP Framework
jiga replied 2 years ago

But if I do that:
If you want to customize any specific column properties, and let other columns be displayed from table definition, you can pass 2nd argument of set_columns($cols,true) to true.
$col = array();
$col[“name”] = “company”;
$col[“edittype”] = “textarea”;
$cols[] = $col;

Only column with name ‘company’ will be changed to textarea and rest table column will be displayed as they were before.

NOTE: The first column must have unique data (usually PK) in order to work properly. It is required to identify and perform row wise operations. You can make it hidden in grid if you wish. See hidden property in later section for more.

would this be a problem?

Your Answer

17 + 9 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?