PDA

View Full Version : ModelManager gives me function()



chrisjs
5 Apr 2012, 1:54 AM
Hello,

i want to get the fields from a model in order to build a dynamic search window. The search needs to know, which fields it should use.
I try to use ModelManager to get the model.

I have set a breakpoint in my controller. When i enter

Ext.ModelManager.getModel('onlineplus.AccountManager.model.User')


in Firebug, i always get just

function()

When i examine Ext.ModelManager it shows (pic in attachment)

Is this the right way to get a list of the fields from my model?

vietits
5 Apr 2012, 2:14 AM
Ext.ModelManager.getModel() return model class, which is in fact an instance of Function. The code below shows how to refer to the fields of a model:


var model = Ext.ModelManager.getModel('onlineplus.AccountManager.model.User');
console.log(model.prototype.fields);