i have done so :
mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath(’<?= $mosConfig_live_site ?>/includes/js/dhtmlxgrid/codebase/imgs/’);
mygrid.setHeader(’<?=addslashes($grid_col)?>’);
mygrid.setInitWidths(’<?=$grid_col_width?>’);
mygrid.setColAlign(’<?=$grid_col_align?>’);
mygrid.setColTypes(’<?=$grid_col_types?>’);
mygrid.setColSorting(’<?=$grid_col_sorting?>’);
mygrid.enableAlterCss(‘even’,‘uneven’);
mygrid.enableAutoHeigth(true);
mygrid.enableMultiline(true);
mygrid.init();
mygrid.setSkin(‘light’);
mygrid.setOnCheckHandler(doOnCheck);
mygrid.loadXML(’<?= $mosConfig_live_site ?>/xml_trees/<?= $actFileName ?>’, function(){
mygrid.attachHeader(’<?=$grid_col2?>’);
document.getElementById(‘c_u’).appendChild(document.getElementById(‘c_u_box’).childNodes[0]);
mygrid.setSizes();
mygrid.setOnGridReconstructedHandler(onGridReconstructed);
mygrid.callEvent(‘onGridReconstructed’,[]);
});
yet the columns are left aligned . The $grid_col_align is 'center,center,center,center and so one ’
The only situation when such problem may occur - the XML which you are loading contains head/column section with different configuration , which redefine js settings.
In any other case align must work ( sample attached )
If problem still occurs for you - please provide any kind of sample where issue can be reconstructed ( you can send it directly to support@dhtmlx.com )
1212145300.zip (84.9 KB)