I have a grid where the xml data is being loaded correctly but it is not visible because the height of the data area div is 0. Can you give me any leads as to what might cause this? Other grids attached to the same layout work fine.
This is the generated HTML for the data area of the grid. Note the height of the div is .
|
|
|
|
---|---|---|---|
Comment | test sa 1 client 1 | ||
16-05-2009 | Comment | test2 | |
18-05-2009 | Comment | test |
Here is the XML that is loading into the grid:
<?xml version="1.0" encoding="iso-8859-1"?>
<![CDATA[test
sa 1 client 1]]>
16-05-2009
18-05-2009
I have configuration files and a generic function to initialise my grids. In this case the configuration contains:
‘grid’ => array(
‘header’ => array(
‘row_1’ => ‘Date,Type,Description,Related To’,
‘row_2’ => ‘#numeric_filter,#select_filter,#text_filter,#text_filter’
),
‘widths’ => ‘75,50,*,75’,
‘col_align’ => ‘left,left,left,left’,
‘col_sorting’ => ‘date,str,str,str’,
),
The grid initialisation function contains (mix of php & javascript):
gridsChild[‘child_tab_".$tab[‘identifier’]."’] = tabbarChild.cells(‘child_tab_".$tab[‘identifier’]."’).attachGrid();
gridsChild[‘child_tab_".$tab[‘identifier’]."’].setImagePath(dhtmlx_codebase_path+‘imgs/’);
gridsChild[‘child_tab_".$tab[‘identifier’]."’].setSkin(‘light’);
gridsChild[‘child_tab_".$tab[‘identifier’]."’].setHeader(’".$tab[‘grid’][‘header’][‘row_1’]."’);
gridsChild[‘child_tab_".$tab[‘identifier’]."’].attachHeader(’".$tab[‘grid’][‘header’][‘row_2’]."’);
gridsChild[‘child_tab_".$tab[‘identifier’]."’].setInitWidths(’".$tab[‘grid’][‘widths’]."’);
gridsChild[‘child_tab_".$tab[‘identifier’]."’].setColAlign(’".$tab[‘grid’][‘col_align’]."’);
gridsChild[‘child_tab_".$tab[‘identifier’]."’].setColSorting(’".$tab[‘grid’][‘col_sorting’]."’);
gridsChild[‘child_tab_".$tab[‘identifier’]."’].init();
gridsChild[‘child_tab_".$tab[‘identifier’]."’].enableSmartRendering(true, 50);
gridsChild[‘child_tab_".$tab[‘identifier’]."’].setUserData(’’,‘data_source’,’".url_for($tab[‘module’]."/getMainListXML")."/s_".$tab[‘parent’]."_id/’);
The grid is loaded when the containing tab is clicked as follows:
function reloadTab(id){
if (gridsChild[id] != undefined){
data_source = gridsChild[id].getUserData(’’,‘data_source’);
if (current_parent_id != undefined){
var uid="/uid/"+(new Date()).valueOf();
gridsChild[id].clearAll();
gridsChild[id].loadXML(data_source+current_parent_id+uid);
// gridsChild[id].clearAndLoad(data_source+current_parent_id);
gridsChild[id].setUserData(’’,‘data_source’,data_source);
}else{
gridsChild[id].clearAll();
gridsChild[id].setUserData(’’,‘data_source’,data_source);
}
}
}
Again, everything seems to load correctly it’s just that the data rows aren’t actually visible. What causes the height to be set to 0?