I am trying to connect a Grid to a SQLServer database. The PHP connector allows me to populate the grid, but when I try adding the dataProcessor, the grid goes blank.
PHP Code (data.php):
<?php require("../codebase/connector/grid_connector.php"); require("../codebase/connector/db_sqlsrv.php"); $myServer = "ntserver4"; $myUser = "sa"; $myPass = "sapassword"; $myDB = "Scheduler"; //connection to the database $connectionInfo = array( "Database"=>$myDB, "UID"=>$myUser, "PWD"=>$myPass); $conn = sqlsrv_connect( $myServer, $connectionInfo); $gridConn = new GridConnector($conn,"SQLSrv");// connector initialization $gridConn->enable_log("temp.log",true); $gridConn->render_table("Projects","ProjectID","ProjectID, ProjectNumber, ProjectName"); ?>Working code for Projects.html:
<p>Blueline Projects</p>
<div id="gridbox" style="width:400px; height:300px; background-color:white;"></div>
<script>
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setHeader("ID,Project #,Project Name");
mygrid.setInitWidths("100,100,200");
mygrid.load("php/data.php");
mygrid.init();
//myDP = new dataProcessor("php/data.php");// initializes dhtmlxDataProcessor
//myDP.init(mygrid);
</script>
When I comment out mygrid.init(); and uncomment the two lines below for the dataProcessor, the grid goes blank. Any ideas?