Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Fernando Siles on Sep 09, 2008 03:54
open dhtmlx forum
Problem with Attach Footer with <div> in TreeGrid

Hi,

I hope that you can help me.

I build a treegrid by xml as follows:


xml.append(initafterinit);
String callAttachFooter = initcall1 + "attachFooter" + initcall2;
String txtFooter = "Resultado de ingresos - gastos por periodo:";

String cadparamsfooter = txtFooter + ",#cspan,#cspan,#cspan,#cspan,#cspan,#cspan";
for(z = 0; z < nperiodos; z++)
{                
    cadparamsfooter += ",<div id='p"+z+"'></div>";                 
}

String attachFooter = callAttachFooter + initparam + cadparamsfooter + endparam + endcall;
xml.append(attachFooter);
            
xml.append(endafterinit);


Xml file looks as follows:


<afterInit>

<call command="attachFooter">

<param>Resultado de ingresos - gastos por periodo:,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,<div

id='p0'></div>,<div id='p1'></div>,<div id='p2'></div>,<div id='p3'></div>,<div id='p4'></div>,<div

id='p5'></div>,<div id='p6'></div>,<div id='p7'></div>,<div id='p8'></div>,<div id='p9'></div>,<div

id='p10'></div>,<div id='p11'></div>,<div id='p12'></div>,<div id='p13'></div>,<div id='p14'></div>

,<div id='p15'></div>,<div id='p16'></div>,<div id='p17'></div>,<div id='p18'></div>,<div id='p19'><

/div>,<div id='p20'></div>,<div id='p21'></div>,<div id='p22'></div>,<div id='p23'></div></param>            

</call></afterInit>


But it doesn't work, why?

Thanks in advance.
Answer posted by Support on Sep 09, 2008 04:21
XML parser treats div as XML tags in case of above code, the correct XML must look as

<call command="attachFooter"><param><![CDATA[

Resultado de ingresos - gastos por periodo:,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,<div  id='p0'></div>,<div id='p1'></div>,<div id='p2'></div>,<div id='p3'></div>,<div id='p4'></div>,<div  id='p5'></div>,<div id='p6'></div>,<div id='p7'></div>,<div id='p8'></div>,<div id='p9'></div>,<div  id='p10'></div>,<div id='p11'></div>,<div id='p12'></div>,<div id='p13'></div>,<div id='p14'></div> ,<div id='p15'></div>,<div id='p16'></div>,<div id='p17'></div>,<div id='p18'></div>,<div id='p19'></div>,<div id='p20'></div>,<div id='p21'></div>,<div id='p22'></div>,<div id='p23'></div>

]]></param></call>


Answer posted by Fernando Siles on Sep 09, 2008 04:31
Thank you very much.

My problem has been solved with your answer.

See you.