问题
I use split mode and smartrender in dhtmlx grid. After I sort rows, rendered rows disappear and never come out on the right side, like the following picture.
after sorting, rows on right side could not be rendered anymore(click here to view the picture)
It's strange, rows on the left could be rendered when I scrolling on both sides.But rows on right side could not be rendered.
Anyone helps? Thanks!
code structure:
var grid = new dhtmlXGridObject('#container');
grid.setImagePath("./bower_components/dhtmlxSuitePro/4.1.1/codebase/imgs/");
grid.enableTreeCellEdit(false);
grid.setHeader('...');
grid.attachHeader('...');
grid.setInitWidths('...');
grid.setColAlign('...');
grid.setColTypes('...');
grid.setColSorting('...');
grid.splitAt(2);
grid.enableSmartRendering(true);
grid.init();
grid.parse(data,'json'); // data is defined
回答1:
Finally, after reading the docs again, I found grid.enableSmartRendering(true);
should be after grid.init();
code following works:
var grid = new dhtmlXGridObject('#container');
grid.setImagePath("./bower_components/dhtmlxSuitePro/4.1.1/codebase/imgs/");
grid.enableTreeCellEdit(false);
grid.setHeader('...');
grid.attachHeader('...');
grid.setInitWidths('...');
grid.setColAlign('...');
grid.setColTypes('...');
grid.setColSorting('...');
grid.init();
grid.splitAt(2);
grid.enableSmartRendering(true);
grid.parse(data,'json'); // data is defined
来源:https://stackoverflow.com/questions/39157170/dhtmlx-grid-smartrender-not-work-normally-after-sorting-with-splitat-mode