[GH #5112] Applying filter and then rendering some values but changes are not picked

Tags: #<Tag:0x00007fd2ca3dea88> #<Tag:0x00007fd2ca3ddf20>

Hi - I have an issue using handsontable. I am using filtering in handsontable described in javascript. So when I fitler in UI for specific dates and then change value of cell then try to submit, Change is not retained for that cell. This is due to position of cell which gets picked up when in filtered mode as compare to its position before filtering.
Any clue how I can handle this?

And also how to handle filter programmatically i.e if I need to clear out all filters then how can I do that in java script?

Hey @mipurelife

can you share a demo with your recent progress? I think that it would be much easier to talk about the tasks by using a living example.

Hi Sure.

So you look at screenshots below

Following is the handsone table display
Filter is on Date and currently I don’t have filter and we have data for two dates i.e 26th June and 28th June.

Now once I apply filter

Now I change value for 1st row; current row highlighted is 1st row. And I made change to it from 122 to 123

Now when I will un filter then 1st row is still highlighted but actually it should automatically assume new position of row which is now 25th

So how to update positions of cells as i un filter rows and also if there is any indicator that will give us whether rows are filters or not ? and also how many rows are filtered? I am using handsontable with javascript

This behavior is a result of a bug related to wrong indexes calculations. After releasing this mapper (work in progress) https://github.com/handsontable/handsontable/issues/5112 the issue should be gone.

Ok thank you. But is there any way I can know if the filter was on or not in renderer through Java script?
I mean any switch or some sort of parameter which is set when filter is turned on?
Meanwhile we have fix for mapper ; i can throw an error is user updates value while filtered is turned on and not let user submit the values?

Hey @mipurelife

you can access all the filter information in the beforeFilter and afterFilters hooks for filtering actions and the instance.getPlugin('Filters') for plugin settings.
The instance.getPlugin('Filters').enabled will tell you if the plugin is enabled.

Hi @aleksandra_budnik;

But I am enabling the filter options all the time.So instance.getPlugin(‘Filters’).enabled is giving me true all the time. My concern was that initially there would be some column on which rows would be filtered ; now if I add more columns to filter criteria then how would I know if filter condition was changed i.e additional filter data is added or removed?

Thank you in advance.

Have you tried the afterFilter hook?

Hi @aleksandra_budnik I tried workaround for it - I used green color as indicator for filter html button when filter is enabled to display a message to un filter all rows to user before proceeding. I will look at afterFilter hook too. Please keep me posted when the fix for calculation of index values for columns when filter is applied happens!

I had one more issue:

I am using keys next to num lock to enter in cells of handsontable , digits work fine but other characters like ‘/’ or ‘-’ etc doesn’t work for keys on num pad. Can you let me know if this is bug or can be handled in some way as its user requirement?

I will.

I have tried all the num-side keys here https://handsontable.com/docs/7.1.0/demo-scrolling.html and they seem to work.

Please share the OS/Browser settings and the keyCode.

@aleksandra_budnik Thank you. I agree handsontable has feature for num keypad support ; it was our internal js which was filtering it out. Much thanks for prompt responses as it helped project to keep on track.

1 Like

hello @aleksandra_budnik What are the updates to the filter problem? Did we launched fix yet? Please keep us posted as team is seeking to implemented updated behavior due to its widespread impact. thanks

Hey @mipurelife

the developer is constantly sending new commits (https://github.com/handsontable/handsontable/issues/5751, last one 23 ago) but as it not in the code freeze yet I did not to send updates.
We should be ready to publish it in September/October.