updateSettings ignores viewportRowRenderingOffset

Tags: #<Tag:0x00007efc728715e8>

Hi Team,

we are facing an issue in version 1.10.1. we cannot upgrade to latest version as it has code-breaking changes.

issue - we call updateSettings() before creating a new row, but it totally ignore viewportRowRenderingOffset. This issue is with 1.10.1 but latest version works fine.

scenario: we apply a filter, limit the resultSet to only 1 row. Then add a new row and the call to updateSettings() is made but it renders all the rows. It should have restricted the resultSet to only 1 row + newly added row.

As this is fixed in new version, could you please help us getting a work-around in old version 1.10.1. Or if the fix is small, we could make it in handson library itself. do let us know the fix and fileName.

here is the code to reproduce the issue.

hot = new Handsontable(container, {
data: Handsontable.helper.createSpreadsheetData(10,2),
colHeaders: true,
rowHeaders: true,
contextMenu: [‘row_above’, ‘row_below’],
colWidths: 150,
dropdownMenu: true,
filters: true,
manualColumnMove: true,
beforeCreateRow: function(index, amount, source){
this.updateSettings({
viewportRowRenderingOffset: this.countRenderedRows(),
viewportColumnRenderingOffset: this.countCols()
});
},
});

Hi @rohit.parwal

we cannot update version before the one that is currently published. If you see that the issue is solved in the latest version you can check what commit fixed it and copy the code to your project. Are you sure that the fix was in the version 1.14.3? Here’s a list of our release notes https://docs.handsontable.com/pro/1.14.3/tutorial-release-notes.html
If you will find the exact version that fixes the issue I will be able to look for the code that fixes it.

Hi Aleksandra,

the issue was fixed in 1.10.2. we are using 1.10.1.

please let us know the fix so that we will put the code fix in our 1.10.1.

thanks

Hi Team, any update on this?

thanks

Hi @rohit.parwal

sorry for a delay. We had some technical problems with the documentation.

Here’s what have changed in version 1.10.2 https://docs.handsontable.com/pro/1.10.2/tutorial-release-notes.html and here is the CE version that corresponds to PRO 1.10.2 https://github.com/handsontable/handsontable/releases/tag/0.31.2
None of these subjects sounds exactly like the problem that we have discussed.

Can you record the issue? I will try to reproduce it with the 1.10.1 version and check which part of the fixes from 1.10.2 can help.

Hi Aleksandra, what do you mean by “can you record the issue”? what inputs do you need from me?

thanks

The video would be great. I am not sure if I get the same result as you do.

Hi Aleksandra, i have very limited resources and i cannot record a video.

you can use following jsfiddle link -
http://jsfiddle.net/fgupq6rq/

and change some code to -
hot = new Handsontable(container, {
data: Handsontable.helper.createSpreadsheetData(10,2),
colHeaders: true,
rowHeaders: true,
contextMenu: [‘row_above’, ‘row_below’],
colWidths: 150,
dropdownMenu: true,
filters: true,
manualColumnMove: true,
beforeCreateRow: function(index, amount, source){
this.updateSettings({
viewportRowRenderingOffset: this.countRenderedRows(),
viewportColumnRenderingOffset: this.countCols()
});
},
});

In the css, change the version of handsontable.full.min.js and handsontable.full.min.css to 1.10.1. You will be able to reproduce the issue. if you switch to version 1.10.2, you will see that issue is not reproducible.

we are using 1.10.1. so we need to put this fix in our code. please take a look at 1.10.2 codebase and suggest us the code changes.

thanks
Ashmi

Hi Team, could you please update us. in the dire need of this one. :slight_smile:

Hi Team, any update on this?

thanks

Hi @rohit.parwal

you cannot use updateSettings inside initialization settings. You should put it outside the initialization settings. If you want it to have inside the beforeCreateRow hook it can look like this http://jsfiddle.net/handsoncode/vct59v3d/

Let me know if it works well in your project

Hi Aleksandra,

its still not working. Please use the version 1.10.1 for handsontable.full.min.css and handsontable.full.min.js in the jsfiddle link you have provided. you will see the issue when you apply a filter and try to add a new row. Once new row is added, the filtered resultset is increased to original unfiltered resultset.

please let us know the fix.

thanks
Ashmi

Thank you for sharing the scenario. I have replicated the issue. However, if you update the library the issue is gone. We are not able to fix previous versions. If you would have any difficulties with updating to newer version just let me know,