Results 1 to 2 of 2

Thread: possible bug?

  1. #1

    Default possible bug?

    PHP Code:
    var model = new Ext.data.Model({
       
    fields: [
        {
    name:'id'},
        {
    name'formobj'}
      ]
    }); 
    console.log:

    me.fields is undefined
    fields = me.fields.items;

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448

    Default

    You shouldn't use the new keyword to create a Model definition. Just like you define a new Class/Component, you use define() for defining a Model.

    Code:
    Ext.define('MyModel', {
        extend : 'Ext.data.Model',
    
        fields : [...]
    });
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •