Results 1 to 2 of 2

Thread: Insert a record in a grouping grid store

  1. #1
    Sencha User harman's Avatar
    Join Date
    Jul 2011
    Location
    India
    Posts
    138
    Answers
    2

    Default Insert a record in a grouping grid store

    Hi,

    I am using an Extjs 4 grouping grid using a store that loads the data from a remote resource using Json.
    On the load event of the store i want to insert a record at the end of the store. I am doing this:-

    Code:
    Ext.define('gridModel', {
        extend: 'Ext.data.Model',
        fields: [
                 {name: 'userName', type: 'String'},
                 {name: 'userId', type: 'String'},
                 {name: 'userAge', type: 'String'}
                 ]
    });
    
    
    var store = new Ext.data.Store({
        // destroy the store if the grid is destroyed
        autoDestroy: true,
        pageSize: 20,
        model: 'gridModel',
        groupField: 'userName',
        remoteSort:false,
        proxy: {
        type: 'ajax',
        url: 'getUserData.json',
        reader: {
        type: 'json',
        root : 'userData',
        totalProperty : 'totalCount'
    }
    },
    listeners:{
        load : function( store, records, successful, operation){
        if(successful){
            var ins_rec = Ext.create('gridModel',{
                userName : 'User99',
                userId : 'User99',
                userAge : '99'
            }); 
            store.insert(store.count(),ins_rec);
        }
    }
    }
    });
    but it gives this error
    "me.summaryGroups[index - 1] is undefined"

    Can anyone help and point out what i am doing wrong?

    Thanks

  2. #2
    Sencha User harman's Avatar
    Join Date
    Jul 2011
    Location
    India
    Posts
    138
    Answers
    2

    Default

    Followed this

    http://www.sencha.com/forum/showthread.php?144701-how-to-insert-a-row-into-group-summary-grid

    b
    ut why cant i insert in a grouping Summary grid??

Tags for this Thread

Posting Permissions

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