-
5 Apr 2012 1:54 AM #1
Answered: ModelManager gives me function()
Answered: ModelManager gives me function()
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
in Firebug, i always get justCode:Ext.ModelManager.getModel('onlineplus.AccountManager.model.User')
When i examine Ext.ModelManager it shows (pic in attachment)Code:function()
Is this the right way to get a list of the fields from my model?
-
Best Answer Posted by vietits
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:
Code:var model = Ext.ModelManager.getModel('onlineplus.AccountManager.model.User'); console.log(model.prototype.fields);
-
5 Apr 2012 2:14 AM #2
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:
Code:var model = Ext.ModelManager.getModel('onlineplus.AccountManager.model.User'); console.log(model.prototype.fields);


Reply With Quote