Categories | Question details Back To List | ||||||||
DHTMLXTreeGrid: Firefox problem with loading subrows (xmlKids option) Hi: I have an example where I am loading certain rows of the table as children rows of one of the rows. When I click on the plus sign, I should get the sub rows from a dynamic script. I used the URL http://www.dhtmlx.com/docs/products/dhtmlxTreeGrid/samples/nodes_rows_manipulations/treeGrid_open.html?un=1206389846000 as an example, and got it to work with IE7. But I am not able to get it to work with Firefox. Through Firebug, I can see that when I click on the 'plus', the request is sent to the server, and the URL is also formed correctly. I can even see the return value XML, which looks like follows: <rows parent='header_1'><row child="1"><cell>test</cell><cell>test</cell><cell >test</cell><cell>test</cell><cell>test</cell><cell>test</cell><cell>test</cell><cell>test</cell><cell >test</cell><cell>test</cell><cell>test</cell></row></rows> The parent XML looks like: <?xml version="1.0" encoding="iso-8859-1"?> <rows> <head> <column width="280" type="tree" align="left" color="#eeeeee" sort="none">Metrics</column> <column width="50" type="ron" align="right" color="white" sort="none">Startup</column> <column width="50" type="ron" align="right" color="white" >#cspan</column> <settings> <colwidth>px</colwidth> </settings> <beforeInit> <call command="attachHeader"><param>#rspan,38952@A<br/>(<i>N</i>=3),#cspan</param> </call> <call command="attachHeader"><param>#rspan,μ,σ</param></call> </beforeInit> <afterInit> </afterInit> </head> <row style="padding:5px;font-size:13px;font-weight:bold;background-color:#95a7d3" id="header_1" xmlkids="1"> <cell image="../../../../../images/transparent_1by1.gif">text</cell> </row> </rows> Answer posted by Support on Mar 25, 2008 03:13 The XML code which you provided basically correct, but it contains few problematic places a) μ,σ = > ampersand need to be escaped b) <br/>(<i>N</i>=3), => the tags need to be escaped, or enclosed in CDATA section Please check attached sample.- it works in both IE and FF ( The FF has problem loading XML if it started not from top xml tag, but from some white-spaces - please be sure that it not occurs in your case ) Attachments (1)
Answer posted by Binod Pant on Mar 25, 2008 07:00 I found out what was wrong with my example. It was the content type. I am using a URL to return a dynamically created XML. That xml was being returned as text/html instead of the correct content type (I found out from Firebug). I had to modify my web servlet to handle this content type, and return the xml as a application/xml type instead. Somehow IE seems to work even without setting the content type. Thanks for your response though. -Binod Answer posted by Support on Mar 25, 2008 09:38 >>Somehow IE seems to work even without setting the content type. In case of IE, loading with incorrect content type is more serious problem, it cause immediate parsing error, dhtmlx loader can detect such error and uses alternative processing method in such case. So far there was no reports about content type related problems with FF, but seems it also can be important. |