Filter Error: ** Assertion failed in Wijmo: function

Posted by: moritz.neugebauer on 14 January 2021, 12:54 am EST

    • Post Options:
    • Link

    Posted 14 January 2021, 12:54 am EST

    Dear Wijmo Team,

    I recently observed an error during runtime when using a column filter. Using a column filter works as expected, but when I leave the page and enter the page again, the error is thrown.

    ERROR Error: Uncaught (in promise): ** Assertion failed in Wijmo: function Column(t){var i=e.call(this)||this;i._f=RowColFlags.ColumnDefault;i._hash=Column._ctr.toString(36);Column.ctr++;Object(grapecity_wijmo__WEBPACK_IMPORTED_MODULE_0[“copy”])(i,t);return i} expected. Error

    at assert (es5-esm.js:14)

    at asType (es5-esm.js:14)

    at WjFlexGridFilter.FlexGridFilter._asColumn (es5-esm.js:14)

    at WjFlexGridFilter.FlexGridFilter.getColumnFilter (es5-esm.js:14)

    at _loop_1 (es5-esm.js:14)

    at WjFlexGridFilter.set [as filterDefinition] (es5-esm.js:14)

    at ColumnStateServiceWijmo.onRestoreClick (ColumnStateServiceWijmo.ts:128)

    at KatalogWerteComponent. (katalog-werte.component.ts:401)

    Whenever the user sets a filter, the filter gets stored to LocalStorage. When entering a page the filter is loaded from the localStorage and then gets applied to the Wijmo Filter.

    
    private filter: wjcGridFilter.FlexGridFilter;
    
    
    
    let json = localStorage[catalogueName];
        if (json) {
          let state = JSON.parse(json);
    
    // restore filter definitions
          if(this.filter) {
            this.filter.filterDefinition = state.filterDefinition; //(ColumnStateServiceWijmo.ts:128)
          }
    }
    
    

    This is how state.filterDefinition looks like

    
    {"defaultFilterType":3,"filters":[{"binding":"status","type":"value","uniqueValues":null,"sortValues":true,"maxValues":250,"exclusiveValueSearch":true,"showValues":{"NEW":true}}]}
    
    

    I recently upgrade to Wijmo version 5.20203.748 but I’m not sure that this behaviour is related to the new version.

    Best regards

    Moritz

  • Posted 17 January 2021, 4:08 pm EST

    Hi Moritz,

    We are sorry for the delayed response. We tried to replicate your issue according to the information provided but unfortunately, we were unable to do so. Please refer to the sample link that we used to replicate the issue:

    https://stackblitz.com/edit/angular-9-0-0-rc-1-nuopsp

    Please let us know if we are missing something in order to replicate your issue. You may also modify the sample above so that it replicates the issue.

    Regards,

    Ashwin

  • Posted 17 January 2021, 7:29 pm EST

    Hi Ashwin,

    thank you for looking into this and providing an example. I will try to dig deeper into the problem. In the meantime…can you please tell me more about the error message? What does it mean exactly?

    Best regards

    Moritz

  • Posted 18 January 2021, 11:11 pm EST

    Hi Moritz,

    After some investigation, I found that this issue may occur if the status column is not present in the FlexGrid but is present in the filterDefinition. Please check this at your end.

    I have forwarded this issue to the developers with internal tracking id 472061 and have asked them whether they will change this behavior in the future release.

    ~regards

  • Posted 31 January 2021, 10:32 pm EST

    Hi Ashwin,

    thank you for further looking into this issue. Yes, in my code the issue was that some columns were not present in the FlexGrid. This was due to some async operations in the ngOnInit() method. I was able to fix it on my side.

    Thank you for pointing me towards this issue.

    Best regards

    Moritz

Need extra support?

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

Learn More

Forum Channels