Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by alberlau on Apr 21, 2009 23:09
open dhtmlx forum
Dhtmlx grid Opera, IE, FF issues

Hello

Currently we evaluating dhtmlx grid. I'm intending to load data via XML.
JS to create grid is as follows:

        mygrid = new dhtmlXGridObject('gridbox');
        mygrid.attachEvent("onKeyPress",evKeyPress);
        //mygrid.setXMLAutoLoading("batchData.htm");
        mygrid.init();
        mygrid.loadXML("batchItems.htm?id=${id}");

XML returned is:

<?xml version="1.0" encoding="UTF-8"?>
<rows>
<pos>0</pos>
<total_count>100</total_count>
<head>
<column type="ed">Sąskaita</column>
<column type="ed">Kreditas</column>
<column type="ed">Kreditas</column>
<column type="ed">Pastaba</column>
</head>
<row id="row1" selected="true">
<cell></cell>
<cell></cell>
<cell></cell>
<cell></cell>
</row>
</rows>

With such configuration grid normally is working only with FF, header is visible and one empty row is visible. With Opera it is not working at all. Headers are not visible ant empty row as described in XML is not visible. IE is working but initial empty row is not visible. Support for IE,FF and Opera is requirement for my project. What mistakes am i doing?

Thanks!
Albertas
Answer posted by dhxSupport on Apr 22, 2009 05:18

Supported loading types are:

  - xml;
  - csv;
  - json;
  - javascript array.

Grid doesn't support loading from "htm" type. If you want load grid from standard xml type your code should looks like that:

 mygrid.loadXML("batchItems.xml?id=${id}");

Plese see more information about loading dates in grid here http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Loading_data_in_grid.html#grid_art_loadingdata

Also every column width have to be difined in the <column> tag or with setInitWidths(wp) method:

<column type="ed" width="150px">Saskaita</column> 
<column type="ed" width="150px">Kreditas</column> 
<column type="ed" width="150px">Kreditas</column> 
<column type="ed" width="150px">Pastaba</column>