1. #1
    Sencha Premium Member
    Join Date
    Apr 2012
    Location
    Mumbai, India
    Posts
    191
    Answers
    10
    Vote Rating
    0
    bomslang has a little shameless behaviour in the past

      0  

    Exclamation Answered: ExtJs 4.1 - Uncaught Error - Cannot read property "items" of undefined.

    Answered: ExtJs 4.1 - Uncaught Error - Cannot read property "items" of undefined.


    Folks,

    I am trying to bring a Json and bind it with the gridpanel in ExtJS 4.1.
    I've checked that it's a valid Json returned. But it's not getting bind with gridpanel.

    Also, it is showing me one error on console.
    error.jpg

    Here's my code :-
    app.js:-

    Code:
    var record = Ext.data.Record.create([
                   {name: 'id'},
                   {
                      name: 'name',
                      type: 'string'
                 }, {
                    name: 'title',
                    type: 'string'
                 }, {
                    name: 'content',
                     type: 'string'
                 }
        ]);
            
    var reader = new Ext.data.reader.Json({
           root: 'data',
            totalProperty: 'total',
            successProperty: 'success'
    }, record);
            
     var writer = new Ext.data.writer.Json({
            encode: true,
           writeAllFields: true
     });
            
    var store = new Ext.data.JsonStore({
          proxy: proxy,
         reader: reader,
         writer: writer,
        fields: ['id','content','name','title'],
         autoSave: false
      });
    
    
    
    
          ....
          ...
    items: [
            {
               xtype: 'gridpanel',
               columns: [
                      { text: 'Name',  dataIndex: 'name' },
                      { text: 'Title', dataIndex: 'title' },
                      { text: 'Content', dataIndex: 'content', flex: 1 }
                 ],
                 store: store
             }       
     ]
    Here's my json returned :-

    Code:
    {
        "data": [
            {
                "name": "Person1",
                "id": 1,
                "content": "Hello World",
                "title": "First App"
            },
            {
                "name": "Person2",
                "id": 2,
                "content": "Great ExtJS Application",
                "title": "ExtJS"
            },
            {
                "name": "Person3",
                "id": 3,
                "content": "Best HTML5 framework",
                "title": "Sencha Touch"
            }
        ],
        "total": 3,
        "success": true
    }


    --
    Bomslang,
    Software Engineer,
    HTML5 Developer | ExtJS, Sencha Touch, GXT Passionate | Json Supporter

    Twitter : @bomslang

    ----------------------------------------------------------------------------------

    # Learn about Sencha Products via it's Documentation : ExtJS | Sencha Touch | GXT

    # Check for correct Json here : JSONLint.com

    # Want to code Sencha Touch Online ? Try SenchaFiddle.com

    # Want to code and test ExtJS Online ? Try http://ext4all.com/ & http://jsfiddle.net/

    # Must Read : 20 things to avoid / do when starting with ExtJS or Sencha Touch

  2. I guess, this example runs according to ExtJS 3.0 documentation.

    I got it working by checking appropriate syntax'es for similar components in ExtJS 4.1.

    Thanks

  3. #2
    Sencha Premium Member
    Join Date
    Apr 2012
    Location
    Mumbai, India
    Posts
    191
    Answers
    10
    Vote Rating
    0
    bomslang has a little shameless behaviour in the past

      0  

    Default


    I guess, this example runs according to ExtJS 3.0 documentation.

    I got it working by checking appropriate syntax'es for similar components in ExtJS 4.1.

    Thanks
    --
    Bomslang,
    Software Engineer,
    HTML5 Developer | ExtJS, Sencha Touch, GXT Passionate | Json Supporter

    Twitter : @bomslang

    ----------------------------------------------------------------------------------

    # Learn about Sencha Products via it's Documentation : ExtJS | Sencha Touch | GXT

    # Check for correct Json here : JSONLint.com

    # Want to code Sencha Touch Online ? Try SenchaFiddle.com

    # Want to code and test ExtJS Online ? Try http://ext4all.com/ & http://jsfiddle.net/

    # Must Read : 20 things to avoid / do when starting with ExtJS or Sencha Touch

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar