Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Steve Boulay on Nov 24, 2009 03:30
open dhtmlx forum
DHTMLX parse XML firefox and chrome

Hello,

I use a XML String to initialize my grid and it's running on ie but it doesn't work on firefox. I have an error on this.obj.firstChild.appendChild(r); in dhtmlxgrid.js line 5717.

Regards

My HTML page is :

<xml id="isl_xml" style="display:none;"><rows>
    <head>
        <beforeInit>
            <call command='setSkin'>
                <param>dhx_skyblue</param>
            </call>
            <call command='enableColumnMove'>
                <param>true</param>
            </call>
            <call command='enableEditEvents'>
                <param>true</param>
                <param>false</param>
                <param>false</param>
            </call>
        </beforeInit>
        <afterInit>
            <call command='enableStableSorting'>
                <param>true</param>
            </call>
            <call command='splitAt'>
                <param>1</param>
            </call>
            <call command='enableHeaderMenu'></call>
        </afterInit>
        <column width="100" type="ed" align="left" sort="str">Nom</column>
        <column width="100" type="ed" align="left" sort="na">Prenom</column>
        <column width="100" type="ed" align="left" sort="na">Age</column>
        <column width="100" type="ed" align="left" sort="str">Sexe</column>
        <column width="100" type="ed" align="left" sort="str">Heure Arrivé</column>
        <column width="100" type="co" align="left" sort="str">Etat
            <option value='T'>Terminée</option>
            <option value='E'>EnCours</option>
            </column>
        <column width="100" type="ed" align="left" sort="str">Medecin</column>
        <column width="100" type="ed" align="left" sort="str">Activite</column>
        <column width="100" type="ed" align="left" sort="str">Protocoles</column>
        <column width="100" type="ed" align="left" sort="str">Origine RDV</column>
        <column width="100" type="ed" align="left" sort="str">Patientele</column>
        <column width="100" type="ed" align="left" sort="str">RDV multi</column>
        <column width="100" type="ed" align="left" sort="str">Type Facture</column>
        <column width="100" type="ed" align="left" sort="str">Compte-Rendu</column>
        <column width="100" type="ed" align="left" sort="na">DicteeDebut</column>
        <column width="100" type="ed" align="left" sort="na">DicteeFin</column>    
    </head>
    <row id="row1">
        <cell id="chp1_3">DUPONT DE LA RIVIERE</cell>
        <cell id="chp1_4">Martine</cell>
        <cell id="chp1_5">59a</cell>
        <cell id="chp1_6">F</cell>
        <cell id="chp1_1">08:20</cell>
        <cell id="chp1_2">E</cell>
        <cell id="chp1_7">BagurJ</cell>
        <cell id="chp1_8">RAD</cell>
        <cell id="chp1_9">PANO</cell>
        <cell id="chp1_10">C</cell>
        <cell id="chp1_11">E</cell>
        <cell id="chp1_12">P</cell>
        <cell id="chp1_13">FD</cell>
        <cell id="chp1_14">Worklist</cell>
        <cell id="chp1_15">Debut</cell>
        <cell id="chp1_16">Fin</cell>
    </row>
    <row id="row2">
        <cell id="chp2_3">AUSSEMS</cell>
        <cell id="chp2_4">Isabelle</cell>
        <cell id="chp2_5">59a</cell>
        <cell id="chp2_6">F</cell>
        <cell id="chp2_1">08:30</cell>
        <cell id="chp2_2">T</cell>
        <cell id="chp2_7">BagurJ</cell>
        <cell id="chp2_8">ECH</cell>
        <cell id="chp2_9">MAIN</cell>
        <cell id="chp2_10">C</cell>
        <cell id="chp2_11">H</cell>
        <cell id="chp2_12">P</cell>
        <cell id="chp2_13">FD</cell>
        <cell id="chp2_14">CRPret</cell>
        <cell id="chp2_15">Debut</cell>
        <cell id="chp2_16">Fin</cell>
    </row>
    <row id="row3">
        <cell id="chp3_3">AUSSEMS</cell>
        <cell id="chp3_4">Andre</cell>
        <cell id="chp3_5">59a</cell>
        <cell id="chp3_6">F</cell>
        <cell id="chp3_1">08:40</cell>
        <cell id="chp3_2">T</cell>
        <cell id="chp3_7">BagurJ</cell>
        <cell id="chp3_8">ECH</cell>
        <cell id="chp3_9">MAIN</cell>
        <cell id="chp3_10">C</cell>
        <cell id="chp3_11">H</cell>
        <cell id="chp3_12">P</cell>
        <cell id="chp3_13">FD</cell>
        <cell id="chp3_14">CRPret</cell>
        <cell id="chp3_15">Debut</cell>
        <cell id="chp3_16">Fin</cell>
    </row>
    </rows>
</xml>
<script>

    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.clearAll();
    mygrid.parse(document.getElementById('isl_xml'));
</script>
Answer posted by Stanislav (support) on Nov 24, 2009 06:02
The problem is in XML parsing ability of FF, to fix the issue change the code as



<textarea id="isl_xml" style="display:none;"><rows> 
  ..old xml here ... 
</rows>
</textarea
<script>

mygrid = new dhtmlXGridObject('gridbox');
   mygrid.clearAll(); 
   mygrid.parse(document.getElementById('isl_xml').value); 
</script>
Answer posted by Steve Boulay on Nov 24, 2009 07:09
Thanks