Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by malx on Apr 10, 2009 01:08
open dhtmlx forum
About Parse function

About Parse function

DHTMLX version :v.1.6 Pro

I didn't use loadXML method.Instead of parse method.Error is happened.
Error message is : "Error type :LoadXML Description:Incorrect xml" .

source code :

    <link rel='STYLESHEET' type='text/css' href='codebase/dhtmlxgrid.css'>
    <link rel='STYLESHEET' type='text/css' href='codebase/dhtmlxgrid_skins.css'>
    <script src='codebase/dhtmlxcommon.js'></script>
    <script src='codebase/dhtmlxgrid.js'></script>
    <script src='codebase/dhtmlxgridcell.js'></script>

    <table width="600" cellspacing="0" cellpadding="0">
        <tr>
            <td width="50%" valign="top">
                <div id="gridbox" width="100%" height="250px" style="background-color:white;"></div>
            </td>

        </tr>
    </table>
<br>


<script>
    var mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath('codebase/imgs/');
    mygrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
    mygrid.attachHeader(" ,#text_filter,#select_filter, ,#cspan,#cspan,#cspan,#cspan");
    mygrid.setInitWidths("50,150,120,80,80,80,80,200")
    mygrid.setColTypes("ed,ed,link,price,ch,co,ro,ro");
mygrid.getCombo(5).put(2,2);

    mygrid.setColSorting("int,str,str,int,str,str,str,date")
    mygrid.init();
    mygrid.setSkin("light");
    mygrid.enableDistributedParsing(true,10,10);
//mygrid.loadXML("500.xml");
    mygrid.parse("500.xml");
</script>


I don't know the reason of this error.

Thanks a lot.

malx
Answer posted by dhxSupport on Apr 10, 2009 01:19
parse() method loads data from an xml object (xmlhttprequest or XML island). To load xml from external file you have to use load() method. Please see more information here http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Loading_data_in_grid.html#grid_art_loadingdata