In Ext 3.x I could get an array of field names with this:
mystore.fields.keys
How can I do this in 4.0? I can't even see how I can get the model that the store is using (no 'getModel' method). Do I need to find a record and get the fields that way? I define the store with :
Ext.define('AM.store.Equipments', {
extend: 'Ext.data.Store',
model: 'AM.model.Equipment',
mycustFunc: function () {
var myfields = this.fields.keys (fails!)
EDIT: Thanks... looking in firebug more it seems like this gets what I want:
this.model.prototype.fields.keys
While there isn't a getModel()
method for the Store itself, the Proxy holds the Model, so you can simply use store.getProxy().getModel()
to fetch the Model, and thereby the Model's fields. For replicating a Store, just use model: originalStore.getProxy().getModel().modelName.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With