Hi,
I use the dhtmlXGridFromTable in the previous version and everything works.
If I use the dhtmlXGridFromTable in the new version it doesn’t work!
In the same conditions!
Some idea?
Regards,
CHW
The old version copied exact HTML from table directly in grid, which allowed to reflect HTML exactly as it was in table, but not allows to use API against such rows ( smart rendering mode for example )
Starting from dhtmlxgrid 1.6, source HTML table used only as datasource - only data from table cells used, any styles attached directly to TD|TR elements will be ignored - as result it allow to use all API of grid.
Hi,
Can you give some instructions about the alteration?
The key point is a _process_html_row method, it converts HTML row to grid’s data structure.
dhtmlXGridObject.prototype._process_html_row=function(r,xml){
var cellsCol = xml.getElementsByTagName(‘TD’);
var strAr = [];
r._attrs=this._xml_attrs(xml); // this line copy and store all attributes or row tag
for(var j=0;j<cellsCol.length;j++){
var cellVal=cellsCol[j];
var exc=cellVal.getAttribute(“type”);
if (r.childNodes[j]){
if (exc)
r.childNodes[j]._cellType=exc;
r.childNodes[j]._attrs=this._xml_attrs(cellsCol[j]); //copy all attributes or TD tags
//if you have some styling attributes you can reflect them as the style attribute
r.childNodes[j]._attrs[“style”]=“background-color:”+cellsCol[j]+";"; //store bgcolor attribute as part of cell’s data