Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Dec 14, 2009 21:47
open dhtmlx forum
give me solution of theis error "this.entBox has no properties"

hi i m using dataprocessor code and i m stuck up here it give me error " this.entBox has no properties" in dhtmlxgrid.js line no. 19


what i do . please give me solution .


thios is my code


<link rel="STYLESHEET" type="text/css" href="../dhtmlxGrid/codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="../dhtmlxGrid/codebase/skins/dhtmlxgrid_dhx_blue.css">
<script src="../dhtmlxGrid/dhtmlxGrid/codebase/dhtmlxcommon.js"></script>
<script src="../dhtmlxGrid/dhtmlxGrid/codebase/dhtmlxgrid.js"></script>
<script src="../dhtmlxGrid/dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>
<script src="../dhtmlxGrid/dhtmlxDataProcessor/codebase/dhtmlxdataprocessor.js"></script>

<div id="gridbox" style="width:600px;height:270px;overflow:hidden"></div>


<script>

//init grid and set its parameters (this part as always);
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../dhtmlxGrid/codebase/imgs/");
mygrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
mygrid.setInitWidths("50,150,120,80,80,80,80,200");
mygrid.setColAlign("right,left,left,right,center,left,center,center");
mygrid.setColTypes("dyn,ed,txt,price,ch,coro,ch,ro");
mygrid.setSkin("dhx_skyblue");
mygrid.setColSorting("int,str,str,int,str,str,str,date");
mygrid.init();
mygrid.loadXML("php/get.php");
//used just for demo purposes;
//============================================================================================;
myDataProcessor = new dataProcessor("php/update.php");
//lock feed url;
myDataProcessor.init(mygrid);
//link dataprocessor to the grid;
//============================================================================================;

</script>





<?php
/*
Copyright DHTMLX LTD. http://www.dhtmlx.com
This version of Software is free for using in non-commercial applications.
For commercial use please contact sales@dhtmlx.com to obtain license
*/

//include db connection settings
error_reporting(E_ALL ^ E_NOTICE);

require_once("../common/config.php");

$link = mysql_pconnect($mysql_host, $mysql_user, $mysql_pasw);
$db = mysql_select_db ($mysql_db);


//start session to build different trees for different sessions (if you set $_SESSION["id"] to some hardcoded value, this way of processing will be skipped)
session_start();
//$_SESSION = array();
if(!isset($_SESSION["id"])){
    $_SESSION["id"] = microtime();
    //add some rows to the table if user comes first time
    $sql =     "Insert into samples_grid(sales,title,author,price,instore,shipping,bestseller,pub_date,GUID) ";
    $sql.=     "Values(100,'Your Favotite Book','Bill Starter',23,'1','12','1',null,'".$_SESSION["id"]."')";
    $res = mysql_query ($sql);
    $sql= "Insert into samples_grid(sales,title,author,price,instore,shipping,bestseller,pub_date,GUID) ";
    $sql.=     "Values(-50,'Good Start','Phillip Nomore',12.5,'0','12','0',null,'".$_SESSION["id"]."');";
    $res = mysql_query ($sql);
}


//FUNCTIONS TO USE IN THE CODE LATER

//print tree XML based on parent_id (function calls itself to go through the nested levels)
    function getRowsFromDB($parent_id){
        //get tree level from database taking parent id as incomming argument
        $sql = "SELECT * from samples_grid WHERE GUID='".$_SESSION["id"]."'";
        //echo $sql;
        $res = mysql_query ($sql);
        if($res){
            while($row=mysql_fetch_array($res)){
                //create xml tag for grid row
                print("<row id='".$row['book_id']."'>");
                    print("<cell><![CDATA[".$row['sales']."]]></cell>");
                    print("<cell><![CDATA[".$row['title']."]]></cell>");
                    print("<cell><![CDATA[".$row['author']."]]></cell>");
                    print("<cell><![CDATA[".$row['price']."]]></cell>");
                    print("<cell><![CDATA[".$row['instore']."]]></cell>");
                    print("<cell><![CDATA[".$row['shipping']."]]></cell>");
                    print("<cell><![CDATA[".$row['bestseller']."]]></cell>");
                    print("<cell><![CDATA[".gmdate("m/d/Y",strtotime($row['pub_date']))."]]></cell>");
                //close xml tag for the row
                print("</row>");
            }
        }else{
            echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file<br>";
        }
    }

//XML HEADER

//include XML Header (as response will be in xml format)
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
        header("Content-type: application/xhtml+xml"); } else {
        header("Content-type: text/xml");
}
echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
?>

<!-- start grid xml -->
<rows id="0">
    
<?php
    //print tree XML
    getRowsFromDB(0);
    //Close db connection
    mysql_close($link);
?>

<!-- close grid xml -->
</rows>





reply me as soon as posssible
Answer posted by dhxSupport on Dec 15, 2009 02:03
Please try to call scripts which initialize grid on body's onload event:
<body onload="doInitGrid()">
<div id="gridbox" style="width:600px;height:270px;overflow:hidden"></div> 
</body>
...
<script>
function doInitGrid(){

//init grid and set its parameters (this part as always);
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("../dhtmlxGrid/codebase/imgs/");
...
}
</script>