Load Table with saved formula

Hi Team,

I am trying to load table with filters which I saved using
AfterFilter Function
afterFilter: function (formulaStack) {
myFormulas = formulaStack;
}

On a button Click I have added a function to Load Table with Saved Filter
var filter1 = hot.getPlugin(‘Filters’);
filter1.formulaCollection = myFormulas;
filter1.filter();

Till here it works fine… but all of the Columns Filter Stop working after this call.

Hi @hardik.chimedia88

can you share a demo with your recent progress?

Hi @aleksandra_budnik

  1. LoadData() → Loads HandsonTable

  1. User Applies Filter

hot = new Handsontable(container, {
dropdownMenu: true,
filters: true,
fillHandle: false,
dropdownMenu: [‘filter_by_value’, ‘filter_action_bar’],

     afterFilter: function (formulaStack) {
   	         myFormulas = formulaStack;      
        },

Here I am saving the filter in myFormulas Variable.

  1. User Click on Cell and Pop up gets opened and whole row data is displayed, which he edits and saves the record (ajax).

  2. So to refresh the row data, LoadData() is Called again to bind all records.

  3. After that, User clicks on apply Prev Filter Button.

  4. So I apply the Saved Filter here,

    $("#btnResetFilter").on("click", function () {
             var filter1 = hot.getPlugin('Filters');
             filter1.formulaCollection = myFormulas;
            filter1.filter();
    

    });

  5. Till here it works fine, but now filter stopped working none of the dropdown filter button is working.

Even after changing the condition it is showing previous filtered records.

If you’re not able to perform any operation after this steps is sounds like an infinite loop. Have you checked the console?

Hi @aleksandra_budnik ,

Its not in infinite loop all the filters has stopped working, it seems like when I am loading the Handsontable for the next time after saving all the filters appers twice and over lap each other

Front Filter Contains all the record of the column but doesnt works, and
back filter works but column contains only selected record from previous state in my case only 3 records are shown in filter.

Please share a JSFiddle with your settings. If I won’t be able to spot a bug I’ll ask my colleague for help.

I am closing the topic as there is no reply for 2 weeks