How to get Filtered data after filter event called?

Tags: #<Tag:0x00007fbe87b9bb60>

I know, using getData() method in after filter hook, we can get the filtered data, but In my scenario, We are saving the filter condition stack in the db and we are making state as dirty to save the filter condition stack.

In the above case, we need to access external service methods, we achieved by below syntax.

// Able to access class/service methods and objects.
afterFilter: (conditionsStack) => {

    console.log('filter config stack', conditionsStack);

    this.updateFilterConfig(conditionsStack);

}

// We cannot access class/service methods or objects only HandsOntable Properties and Methods we could access

afterFilter: function (conditionsStack) {

    console.log('filter config stack', conditionsStack);

    this.updateFilterConfig(conditionsStack);

  }

So, You might understand my problem, we are using first approach and unable to access the method this.getData().

Can you please help us on this scenario?

Thanks
Prabu Kuppusamy

Hi @prabu.kuppusamy

To confirm if we’re on the same page

  • you are doing server-side filtering and are blocking filtering on front-end
  • you use the result of the beforeFilter hook to block the action but gather filter condition stack

The afterFilter hook is fired after the action of filtering and it does not allow you to block the action of filtering.

Sorry for the miscommunication, We are not doing server side filtering, We are saving the filter condition stack in db as json string, so when user is back, we load the grid with what he filtered last time, If the user filtered the grid and save, the next time when he visit, the grid will load with same filtered data.

So, Kindly read my question again. Thank you.

Well, then I have one more question. Is the dataset changeable? Can someone add a new row or delete a row completely?

No, we didn’t enabled those Add/Delete row Options.

OK. Great. We are one step closer to solve this case.

Please send me your license ID and this forum link to support@handsontable.com so I can move on with creating a demo for you. I need to confirm your license status to proceed with a custom demo creation.

Thanks for the response, I’ll forward the license information to that mail Id. Thank you

Thank you. I think that we can close this topic then.