Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by jswsx on Nov 05, 2008 02:01
open dhtmlx forum
netBox has no properties

hello.

i have an error when use TreeGrid loaddate from XML; the function dhtmlXGridObject(id) throws an exception with the message "
entBox has no properties " .
this function in dhtmlxgrid.js, error at line : this.entBox.className += " gridbox";

why it says that it doesnt have properties?. how can i fix that error?

Thanks.

HTML script:
<script>
mygrid = new dhtmlXGridObject('gridbox');
mygrid.setImagePath("/imgs/csh_bluebooks/");
mygrid.setHeader("Title,Price,Quantity,Total");
mygrid.setInitWidths("250,100,80,100");
mygrid.setColAlign("left,right,right,right");
mygrid.setColTypes("tree,price,ed[=sum],price[=sum]");
mygrid.setColSorting("str,int,int,int");
mygrid.setColumnColor("#d5f1ff");
mygrid.setMathRound(2);
mygrid.init();
mygrid.LoadXml("treegrid.xml");
</script>

<SCRIPT src="TreeGrid/dhtmlxcommon.js"></SCRIPT>

<SCRIPT src="TreeGrid/dhtmlxgrid.js"></SCRIPT>

<SCRIPT src="TreeGrid/dhtmlxgridcell.js"></SCRIPT>

<SCRIPT src="TreeGrid/dhtmlxtreegrid.js"></SCRIPT>

<SCRIPT src="TreeGrid/dhtmlxgrid_math.js"></SCRIPT>

XML:
<?xml version="1.0"?>
<rows>
    <row id="11111" open="1">
        <cell>Total</cell>
        <cell>0</cell>
        <cell>11.00</cell>
        <cell>185.48</cell>
        <row id="2" open="1">
            <cell>Music</cell>
            <cell>0</cell>
            <cell>5.00</cell>
            <cell>58.80</cell>
            <row id="2.1">
                <cell>Whatever People Say I Am, That's What I Am Not</cell>
                <cell>9.78</cell>
                <cell>1</cell>
                <cell>9.78</cell>
            </row>
            <row id="2.2">
                <cell>Back to Bedlam</cell>
                <cell>13.28</cell>
                <cell>1</cell>
                <cell>13.28</cell>
            </row>
            <row id="2.3">
                <cell>Prince</cell>
                <cell>10.48</cell>
                <cell>1</cell>
                <cell>10.48</cell>
            </row>
            <row id="2.4">
                <cell>Dreaming Wide Awake</cell>
                <cell>11.98</cell>
                <cell>1</cell>
                <cell>11.98</cell>
            </row>
            <row id="2.5">
                <cell>On an Island</cell>
                <cell>13.28</cell>
                <cell>1</cell>
                <cell>13.28</cell>
            </row>
        </row>
        <row id="3" open="1">
            <cell>DVD</cell>
            <cell>0</cell>
            <cell>6.00</cell>
            <cell>126.68</cell>
            <row id="3.1">
                <cell>Harry Potter and the Goblet of Fire</cell>
                <cell>24.78</cell>
                <cell>1</cell>
                <cell>24.78</cell>
            </row>
            <row id="3.2">
                <cell>Jarhead</cell>
                <cell>20.98</cell>
                <cell>1</cell>
                <cell>20.98</cell>
            </row>
            <row id="3.3">
                <cell>Hogan's Heroes - The Complete Third Season</cell>
                <cell>27.98</cell>
                <cell>1</cell>
                <cell>27.98</cell>
            </row>
            <row id="3.4">
                <cell>Prime</cell>
                <cell>20.98</cell>
                <cell>1</cell>
                <cell>20.98</cell>
            </row>
            <row id="3.5">
                <cell>The Shaggy Dog</cell>
                <cell>15.98</cell>
                <cell>2</cell>
                <cell>31.96</cell>
            </row>
        </row>
    </row>
</rows>

Answer posted by Support on Nov 05, 2008 03:50
The problem occurs when you are using not existing element as parameter of constructor. 
>>mygrid = new dhtmlXGridObject('gridbox');
Be sure that object with such ID as "gridbox" is really exists on the page, and it is already rendered on moment of script call.