dynamic model is not loading fields

Posted by Toby Justus on Stack Overflow See other posts from Stack Overflow or by Toby Justus
Published on 2012-04-05T09:10:13Z Indexed on 2012/04/05 11:28 UTC
Read the original article Hit count: 231

Filed under:
|
|
|

I am using a dynamic model found on the forum of sencha.

function modelFactory(name, fields) {
alert(fields);

return Ext.define(name, {
    extend: 'Ext.data.Model',
    fields: fields
});
}

I placed the alert(fields) to check what happens with the field because it was not working. I get this:

[object Object],[object Object],[object Object]

How can i change this into a correct way to use it in the fields?

Is there a way to check if the model has been created? With Firebug or something?

EDIT:

i get this in firebug:

[Object { name="ccuDesignation", type=null}, Object { name="wanNumber", type=null}, Object { name="carrierName", type=null}, Object { name="dataPackageName", type=null}, Object { name="simIccid", type=null}, Object { name="expiryTime", type=null}, Object { name="bytesRx", type=null}, Object { name="bytesTx", type=null}] 

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about dynamic