I've a grid with a subgrid. I've enabled the 'add' and 'edit' options in the subgrid, show the form correctly but when clicked the save button the data are not saved in the database.
Why?
the grid code: gridavisos.php
require_once 'jq-config.php';
// include the jqGrid Class
require_once ABSPATH.”jqGrid.php”;
// include the driver class
require_once ABSPATH.”jqGridPdo.php”;
// Connection to the server
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
// Tell the db that we use utf-8
$conn->query(“SET NAMES utf8”);
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// this table is 1252 encoded, so we need to tell the grid
// Set the table data source
$grid->setTable('clientes');
// set the ouput format to xml since json have problems
$grid->dataType = 'xml';
// Let the grid create the model
$grid->setColModel();
// Set the url from where we obtain the data
$grid->setUrl('gridavisos.php');
// Set some grid options
$grid->setGridOptions(array(“height”=>400,”hoverrows”=>true,”autowidth”=>true,”rowNum”=>20,”rowList”=>array(20,50,100),”sortname”=>”nombre”));
$grid->setColProperty(“cif”, array(“width”=>90));
$grid->setColProperty(“cp”, array(“width”=>45));
$grid->setColProperty(“provincia”, array(“width”=>80));
$grid->setColProperty(“telefono”, array(“width”=>60));
// We can hide some columns
$grid->setColProperty(“id_cliente”, array(“hidden”=>true));
// set labels in the header
$grid->setColProperty(“nombre”, array(“label”=>”Nombre”));
$grid->setColProperty(“cif”, array(“label”=>”NIF”));
$grid->setColProperty(“direccion”, array(“label”=>”Direcci
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top