No difference between RangeFiltering/RangeFiltered and RangeSorting/RangeSorted

Posted by: lpagliaro on 7 December 2017, 8:55 am EST

    • Post Options:
    • Link

    Posted 7 December 2017, 8:55 am EST

    Hi. I’m trying to build a command to support undo/redo for a filter and sort change. I thought that I could use the event RangeFiltering to get the current status of the filter (before is filtered) but looks like the filtering was already done when the event is triggered , so I can’t get the previous filter state. Same thing happens with RangeSorting. (I need the previous state for the command so I can save the state to be able to undo it)

    RangeFiltered and RangeSorted also don’t give me any information about the previous state, only what’s changed, same as RangeFiltering and RangeSorting. Basically, there’s no difference in these events.

    Any suggestion on how to approach this?

  • Posted 11 December 2017, 12:04 pm EST

    Hello,

    I saved JSON during RangeFiltering and RangeFiltered event and the result was not same. In RangeFiltered event it gives the filtered view. Please refer to the attached sample.

    SpreadJSFilterSortingEvents.zip

  • Posted 12 December 2017, 10:01 am EST

    I’ve updated your sample to log rowFilter.

    When you load the sample, if you filter an item, in the console log you’ll see what’s attached in image 1. You can see that in this case we have the previous state when nothing is filtered (RangeFiltering event) and then the log for when the filter was applied (RangeFiltered event); the log for the rangeFiltered event show the filteredColumns and filteredOutRows properly. So far so good. Now add again the filtered item and you’ll get the log that is in image 2. Here the logs are the same for both RangeFiltering and RangeFiltered, when in RangeFiltering I should have the values before applying the filter (filteredColumns and filteredOutRows properties), because the transition went from a filtered items state to a no items filtered.

    Thanks for your help.

    SpreadJSFilterSortingEvents.zip

    Logs.zip

  • Posted 13 December 2017, 8:38 am EST

    Any other ideas on how to solve this issue?

    Thanks.

  • Posted 14 December 2017, 2:01 pm EST

    Hi, Deepak. Any updates on this issue?

    Thanks.

    Regards.

  • Posted 15 December 2017, 3:25 am EST

    Hello,

    It looks to be correct behavior, RangeFiltering event does not hold any information about the filtering rows when there is no filtered out item. It does not have any ‘filterItemMap’ when you have added all the filtered items back. Because when you have added all items it only needs to load the default sheet with all values. It is the default behavior.

    Thanks,

    Deepak Sharma

  • Posted 15 December 2017, 8:53 am EST

    But in the second example RangeFiltering should have the filtered values. Did you understand my example above?

    Let’s assume you load an spreadsheet with a filter that has already filtered items. When you select to add all the items again, RangeFiltering should have the information of the filtered items still, because the adding back of the items didn’t happen yet. And then RangeFiltered shouldn’t have the information because the filtering happpened.

    I added the explanation to the images so it is more clear.

  • Posted 18 December 2017, 3:11 pm EST

    Hi, Deepak. Were you able to take a look at the issue?

  • Posted 19 December 2017, 7:29 am EST

    Hello,

    It looks like an issue to me with the RangeFiltering event.

    I have asked the development team to look into this issue. I will let you know about their findings as soon as I get an update on this.

    The tracking id for this issue is 251788

    Thanks,

    Deepak Sharma

  • Posted 13 June 2018, 6:06 am EST

    Hello,

    Your issue has been fixed in latest build which can be downloaded from the website.

    Thanks,

    Reeva

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels