View Full Version : Prevent isEmptyStore of null console error when resetting a from in MVVM

1 Sep 2020, 1:06 PM

I have an MVVM application, I have a view with form containing two combo boxes.

The view model loads a store and is bound to the first combo box, using formulas for getting and setting the record.

The second combobox is bound to a nested json feed of the fist, when the first combobox is selected the associated nested data is load as a store on the second combobox.

All is fine and working as expected.

The issue is, I have a form reset button and when I reset the form..reset();

It clears the first combobox it tries to clear the second but of course when the first combo box is reset it removes the store from the second one.

I get this error in the browsers javascript console.

app.js:1 Uncaught TypeError: Cannot read property 'isEmptyStore' of null
at ctor.getValue (app.js:1)
at ctor.assertValue (app.js:1)
at ctor.completeEdit (app.js:1)
at ctor.onFocusLeave (app.js:1)
at ctor.onFocusLeave (app.js:1)
at ctor.onGlobalFocus (app.js:1)
at ctor.fire (app.js:1)
at ctor.doFireEvent (app.js:1)
at ctor.b.doFireEvent (app.js:1)
at ctor.fireEventArgs (app.js:1)

I do I reset the form and prevent this.