Hi all,
I’m new here, fairly new to php/jquery and a complete beginner with regard to DHTMLX so apologies if anything I post sounds really dumb.
My problem is this, I’ve implemented DHTMLX grid to display some data and allow it to be edited dynamically (well more dynamically than the standard php solution I was using) and for some reason it will only ever display the first three columns from the query and I’m stumped
my initialization code looks like this:
[code]
<!-- load the files required by the basic files required by the grid and its style sheet -->
<script type ="text/javascript" >
function doInitGrid(){
mygrid = new dhtmlXGridObject('mygrid_container');
mygrid.setImagePath("codebase/imgs/");
mygrid.setHeader("ID,Forename,Surname,Email,Phone");
mygrid.setInitWidths("150,150,150,150,150");
mygrid.setColAlign("left,right,right");
mygrid.setSkin("light");
mygrid.setColSorting("int,str,str,str,int");
mygrid.setColTypes("ed,ed,ed,ed,ed");
mygrid.init();
mygrid.load("resources/lib/cons/details_gridconfig.php")
}
//an in line script to intilize the grid
</script>
<title></title>
</head>[/code]
an the connector php file (details_gridconfig) looks like this
<?php
define('CONFIG_PATH', $_SERVER['DOCUMENT_ROOT'] . '/resources');
require_once (CONFIG_PATH . '/config.php');
require_once (CODEBASE_PATH . '/connector/grid_connector.php');
$host = $dbConfig ['dbSettings']['mysql']['host'];
$dbName = $dbConfig ['dbSettings']['mysql']['dbname'];
$userName = $dbConfig ['dbSettings']['mysql']['username'];
$pwd = $dbConfig ['dbSettings']['mysql']['password'];
// get the db settings for each paramter an store each in a variable
$conn = mysql_connect($host, $userName, $pwd);
mysql_select_db($dbName);
// create a new connection to the db using variables from config file
$grid_conn = new GridConnector($conn, "MySQL");
// intilize the connector
$grid_conn->render_sql("SELECT * FROM student", "","ID_no,Surname,Forename,Email,Home_Phone_No");
// render the query
?>
I know this works as a standard php query dumped into a table but i just cant get it working
with the grid.
Can anyone help?
Thanks in advance
.