How to put add edit and delete dialog in middle?

QuestionsHow to put add edit and delete dialog in middle?
jiga asked 7 years ago

I dont know how to put the add edit delete dialog in middle, everytime I add edit or delete records the dialog appears on the left side but I need it to appear in the middle
<?php
include_once(“conexion_grid.php”);
// include and create object
//include_once(“lib/inc/adodb/adodb.inc.php”);
include_once(“lib/inc/jqgrid_dist.php”);
$db_conf = array(
“type” => “mysqli”,
“server” => localhost,
“user” => “buho3448_desarro”,
“password” => “desarrollo3!”,
“database” => “buho3448_econ”
);
$g = new jqgrid($db_conf);
$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-barcode’></i> CLAVE”;
$col[“name”] = “cve”;
$col[“width”] = “40”;
$col[“align”] = “center”;
$col[“editable”] = true;
$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”] = true;
$col[“resizable”] = true;
$cols[] = $col;

$grid[“caption”] = “<i class=’fas fa-book’></i> CONTROL ESCOLAR – MATERIAS”;
$grid[“autowidth”] = false;
$grid[“sortable”] = true;
$grid[“rowNum”] = 16;
$grid[“rowList”] = array(10,20,30,40,50,’All’);
$grid[“rownumbers”] = true;
$grid[“rownumWidth”] = 30;
$grid[“forceFit”] = true;
$grid[“shrinkToFit”] = true;
$grid[“resizable”] = true;
$grid[“autoresize”] = true;
$grid[“loadtext”] = “<i class=’fa fa-spinner fa-2x fa-spin’></i> Buscando coindicencias …”;
$grid[“multiselect”] = true;
$grid[“altRows”] = true;
$grid[“sortname”] = ‘id’; //TEN CUIDADO CON ESTOS TE PUEDEN CAUSAR PROBLEMAS EN LAS CONSULTAS
$grid[“sortorder”] = “desc”;
$grid[“cellEdit”] = true;
$grid[“reloadedit”] = true;
$opt[“add_options”][“success_msg”] = “<i class=’fa fa-check’></i> Registro agregado exitosamente”;
$opt[“edit_options”][“success_msg”] = “<i class=’fa fa-check’></i> Registro modificado exitosamente”;
$opt[“delete_options”][“success_msg”] = “<i class=’fa fa-check’></i> Registro eliminado exitosamente”;
$g->set_options($grid);
$g->set_options($opt);
$g->select_command = “SELECT * FROM buho3448_econ.materias”;
$g->table = “buho3448_econ.materias”;
$g->set_columns($cols,true);
$out = $g->render(“list1”);
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”&gt;
<html>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js”></script&gt;
<link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css&#8221; integrity=”sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm” crossorigin=”anonymous”>
<script src=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js&#8221; integrity=”sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl” crossorigin=”anonymous”></script>
<script src=”https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js&#8221; integrity=”sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q” crossorigin=”anonymous”></script>
<script defer src=”https://use.fontawesome.com/releases/v5.0.8/js/all.js&#8221; integrity=”sha384-SlE991lGASHoBfWbelyBPLsUlwY1GwNDJo3jSJO04KZ33K2bwfV9YBauFfnzvynJ” crossorigin=”anonymous”></script>
<link href=”css/css_memo.css” media=”screen” rel=”stylesheet” type=”text/css” />
<link rel=”stylesheet” type=”text/css” media=”screen” href=”lib/js/themes/mint-choc/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>
</head>

1 Answers
Abu Ghufran Staff answered 7 years ago

By default dialogs comes in middle of screen.
You can review them in online demos: http://www.phpgrid.org/demo/demos/editing/index.php

Code: http://www.phpgrid.org/demo/demos/editing/index.phps

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

I solved it
the problem was here

$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”] = true;
$grid[“altRows”] = true;
$grid[“cellEdit”] = true;
$grid[“reloadedit”] = true;
$grid[“caption”] = “ CONTROL ESCOLAR – MATERIAS”;
$grid[“loadtext”] = “ Buscando coindicencias …”;
$grid[“sortname”] = ‘id’; //TEN CUIDADO CON ESTOS TE PUEDEN CAUSAR PROBLEMAS EN LAS CONSULTAS
$grid[“sortorder”] = “desc”;

$opt[“edit_options”][“checkOnSubmit”] = true;
$opt[“add_options”][“success_msg”] = “ Registro agregado exitosamente”;
$opt[“edit_options”][“success_msg”] = “ Registro modificado exitosamente”;
$opt[“delete_options”][“success_msg”] = “ Registro eliminado exitosamente”;

$g->set_options($grid);
$g->set_options($opt);
If i erased one of the set options the dialog works fine but then My custom messagges not, so I changed the name of the variable of the custom messagges and then it work

Your Answer

18 + 12 =

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?