dhtmlx grid smartrender not work normally after sorting with splitAt mode

北城余情 提交于 2019-12-12 02:36:49

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!