Search code examples
jsonextjsextjs4store

Extjs 4 - create new empty Record from Store without Model


I have tried to create a new empty record without creating a model.

Accidentally I tried to run this:

new new storeComp.model()

and it actually works!

anyone know any solution for this or an answer to how is it working ?

Thanks! Shalev


Solution

  • Stores that are not configured with a model will create an anonymous one implicitly. This is explained in the docs for the implicitModel private property (the store needs to know that because if it uses an implicit model, it must destroy it when it is itself destroyed).

    In the end that means that you can safely expect any store to be backed with a model.