Declined
Last Updated: 08 Oct 2019 10:03 by ADMIN
Anna
Created on: 01 Oct 2019 16:44
Category: Filter
Type: Bug Report
0
Filter: loading deprecated filter state throws "TypeError: Cannot read property 'type' of undefined"

Reproduction of the problem

  1. Run the dojo at https://dojo.telerik.com/@GaloisGirl/uBiLIbiP/3 . The state of the filter is "(ContactTitle Is equal to 'Sales Representative')", however, the ContactTitle field has been commented out from the dataSource schema.

Current behavior

The error "TypeError: Cannot read property 'type' of undefined" is thrown

Expected/desired behavior

Some error should be thrown, but one that the developer can recognize and handle appropriately.

Your example of persisting state saves it in localStorage. Say my user saves the state on Monday, and by Tuesday, a column is removed, renamed, has a different type... I need to handle that user's deprecated saved state.


 

 

1 comment
ADMIN
Viktor Tachev
Posted on: 08 Oct 2019 10:03

Hi Anna,

Generally when specifying a model that will be used by the components the fields in it should correspond to the fields used in the widgets. I examined the dojo and should say that the Filter configuration is not valid. Since it is using a field that is not available in the model. 

With that said, if the scenario you have includes modifying the Model in such a way I would suggest adding a bit of additional logic before restoring the settings. Parse the options to JSON and compare the model definition that is stored to the one that is currently available. If they do not match - do not restore the state or prompt the users.

 

Regards,
Viktor Tachev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.