grid splitat and enablesmartrendering

I have two questions:



1. I’ve noticed an odd problem with the dhtmlxgrid when both split and smart rendering are used, if the row heights are not all the same size. The initial display has the rows on both sides of the split with the correct height (so that both lines line up horizontally). However, subsequent lines rendered do not.



2. The user interface I am building will allow a user to set or remove a split dynamically. I’ve read that to do this, I have to call the destructor on the existing grid object, and then reinstantiate and rebuild it. Unfortunately, I seem to hit an error in the code each time after my grid is reconstructed and parses the json object that contains the data displayed in the grid.



The error message occurs on a line “this._dLoadTimer=window.setTimeout(function(){self._update_srnd_view()}, 100)”. After rebuilding the grid, the variable “self” no longer seems to have a function defined for _update_srnd_view (which I find odd, since that is assigned via a prototype).

if the row heights are not all the same size.
Please beware that prior dhtmlxgrid 1.6 , split and multiline modes was not compatible at all. Starting dhtmlxgrid 1.6 - there is a limited support of such mode combination, but be sure to have multiline mode enabled ( mygrid.enableMultiline(true) )

>>2. The user interface I am building will allow a user to set or remove a split dynamically. I
Issue already fixed in latest codebase.
You can
- contact us directly at support@dhtmlx.com to receive updated js files ( please provide your ref. number in such case )
- add next line before executing destructor
if (mygrid._dLoadTimer)
window.clearTimeout(mygrid._dLoadTimer);

mygrid.destructor();


1. I am using enableMultiLine.  The problem seems to be when smart rendering is also introduced.  For example, if I have a row where the cells on the left side of the split would not need multiple lines, but the cells to the right of the split do, the following happens:



    a.) If such a row is in the part of the grid that is initially rendered, it looks just fine.



    b.) If such a row is dynamically rendered during a scroll operation, the height of the left-hand side does not match what is on the right-hand side.



Is there an order-of-operations issue with enableMultiline, enableSmartRendering, and splitAt? Should one of those be called before the others?



2. Thanks for the code fix.  I can use that until the version with the fix is released.

Problem confirmed - such combination of modes as srnd + split + multiline can cause the problem. Starting from dhtmlxgrid 1.6 the multiline and srnd can be used in same time, split and multiiline can be used in same time, but usage of all 3 modes in same time can cause issue. We will look how it can be improved in next version, but there is no simple workaround to enable such mode combination in current version of grid.

I’ve noticed that after scrolling, if one of the columns is the grid is resized, all row heights will be updated to the correct height.  As a temporary workaround, is there an easy way to execute the column resize code after scrolling?

You can try to add the next code

grid.attachEvent(“onRowCreated”,function(id){
grid._correctRowHeight(id);
});


I had to modify that sample somewhat to get it to work.  At the point that onRowCreated is fired, the row has not been added to the grid on the left of the split, which causes the _correctRowHeight function to return without doing anything.  To compensate for this, I did something similar to the following:

grid.attachEvent(“onRowCreated”, doOnRowCreated);

var lastID = null;
function doOnRowCreated(id) {
  if (id != 0) this._correctRowHeight(lastID);
  lastID = id;
}

Also, can be done as

grid.attachEvent(“onRowCreated”,function(id){
window.setTimeout(function(){
grid._correctRowHeight(id);
},1);
});