Updating multiple rows on a large handsontable locks chrome

試著忘記壹切 提交于 2019-12-13 04:23:45

问题


I have a handson table with 300+. It renders quickly. However, if I update one column in all rows like so:

function() {
    console.trace("Start", new Date());
    $scope.myData.forEach(function(elem, idx) {
        elem.properties.myCol = Math.random();
        if (idx % 100 == 0) console.trace("Tick", new Date());
    });
    console.trace("End", new Date());
};

The loop executes in less than a second, but the browser tab locks up and the page does not update for over a minute. Is there some way I can disable handsontable from reading updates to the array and then triggering a manual redraw? Is there any other way to speed this up?


回答1:


After updating the handsontable data you can use $('#yourTable').handsontable("render"); To re-render the handsontable manually after any updates to the data. And set observeChanges:false (It is false by default) while creating handsontable to disable automatic re-rendering by handsontable.




回答2:


The option that was slowing down rendering was columnSorting: true,. Removing this fixed the issue.



来源:https://stackoverflow.com/questions/25921744/updating-multiple-rows-on-a-large-handsontable-locks-chrome

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