Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Francis Corbin on Mar 26, 2009 18:26
open dhtmlx forum
Grid and connector

I am trying to use the grid to access and modify an Oracle database. Following your advice, I was able to retrieve, display and filter data using PDO.

When it comes to updating data though, I can't get it to work and I can't find where the problem is - another issue with PDO maybe?

Here's the script:
**************************************************************************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel='STYLESHEET' type='text/css' href='dhtmlxTools/dhtmlxGrid/codebase/dhtmlxgrid.css'>
<link rel='STYLESHEET' type='text/css' href='dhtmlxTools/dhtmlxGrid/codebase/ext/dhtmlxgrid_pgn_bricks.css' >

<script src='dhtmlxTools/dhtmlxGrid/codebase/dhtmlxcommon.js'></script>
<script src='dhtmlxTools/dhtmlxGrid/codebase/dhtmlxgrid.js'></script>
<script src='dhtmlxTools/dhtmlxGrid/codebase/dhtmlxgridcell.js'></script>
<script src='dhtmlxTools/dhtmlxGrid/codebase/ext/dhtmlxgrid_srnd.js'></script>
<script src='dhtmlxTools/dhtmlxDataProcessor/codebase/dhtmlxdataprocessor.js'></script>
<script src='dhtmlxTools/dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js'></script>
<script src='dhtmlxConnector_PHP/codebase/connector.js'></script>

<script>
function loadGrid() {
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath('dhtmlxTools/dhtmlxGrid/codebase/imgs/');
mygrid.setHeader("rec num,notes");
mygrid.setInitWidths("110,*")
mygrid.setColTypes("ro,ed");
mygrid.setSkin("modern")

mygrid.attachHeader("#numeric_filter,#text_filter");
mygrid.setColSorting("connector,connector");

mygrid.enableSmartRendering(true);
mygrid.init();

mygrid.loadXML("grid_datasource.php");

var dp = new dataProcessor("grid_datasource.php");
dp.init(mygrid);
}

</script>

</head>

<body onload="loadGrid();">

<div id="gridbox" style="width:632px; height:370px;"></div>

</body>
</html>
**************************************************************************

And the php file:
**************************************************************************
<?php
require_once("dhtmlxConnector_php/codebase/grid_connector.php");
require_once("dhtmlxConnector_php/codebase/db_pdo.php");


try {
$dbh = new PDO("oci:dbname=//server:port/database", "user", "pwd");

$grid = new GridConnector($dbh, "PDO");
$grid->enable_log("temp.log",true);
$grid->render_table("MACHINE_RECIPES", "RECORD_NUMBER", "RECORD_NUMBER,RECIPE_NOTES");

} catch (PDOException $e) {
echo "Failed to obtain database handle - error: ". $e->getMessage();
}
?>
**************************************************************************
Answer posted by Support on Mar 27, 2009 02:40
Please check is grid writes data update queries in log file. If some error occurs during data processing - it will be stored there. 
Also, to made client side debugging more easy - add one more js file into html page 
         dhtmlxdataprocessor_debug.js
it will add client side logging . 


If reason of problem still unclear - please provide data from server side and client side log output for problematic situation. ( you can send such info directly to support@dhtlmx.com )