Results 1 to 5 of 5

Thread: Record not deleted from Grid.Store.Proxy.Reader

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    55
    Answers
    2

    Default Answered: Record not deleted from Grid.Store.Proxy.Reader

    Hi,

    I deleted one record from my grid. after deleting a record , grid.store.data shows the records except deleted record.

    but grid.store.proxy.reader showing all records with deleted also. how can i remove record from proxy reader or how to refresh proxy reader?

    here is my code:



    xtype:'gridpanel',
    title:'Data Grid',
    id:'gridId',
    store : Ext.create('Ext.data.Store', {
    fields : ['name', 'email', 'phone'],
    data:[
    {"name":"Lisa", "email":"[email protected]", "phone":"555-111-1224"},
    {"name":"Bart", "email":"[email protected]", "phone":"555--222-1234"},
    {"name":"Homer", "email":"[email protected]", "phone":"555-222-1244"},
    {"name":"Marge", "email":"[email protected]", "phone":"555-222-1254"}
    ],
    }),
    columns: [
    {header: 'Name', dataIndex: 'name'},
    {header: 'Email', dataIndex: 'email', flex:1},
    {header: 'Phone', dataIndex: 'phone'},
    {
    xtype : 'actioncolumn',
    flex : .2,


    id : 'delete',
    align : 'center',
    items : [{
    icon : 'resources/images/icons/delete16.gif',
    tooltip : 'Delete'
    }],
    handler: function(grid, rowIndex, colIndex) {
    var rec = grid.getStore().getAt(rowIndex);
    Ext.getCmp('gridId').getStore().remove(rec);
    Ext.getCmp('gridId').getStore().sync();
    Ext.getCmp('gridId').getView().refresh();
    }


    }
    ],
    height: 200,
    width: 400,
    renderTo: Ext.getBody()



    Thanks in advance.

  2. I fount some solution for that.

    Ext.encode(Ext.pluck(Ext.getCmp('gridId').getStore().tree.root.childNodes[0].store.data.items,'data'))

    it is working fine. i am getting latest data as json format after delete a row.

    Thanks

  3. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    55
    Answers
    2

    Default

    Hi,

    Deleted record not updated in to Store.proxy.data, but store.data is updated.

    Please help me to resolve the issue.

    Thanks in advance.

  4. #3
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,102
    Answers
    113

    Default

    sync()ing your store doesnt refresh it?

  5. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    55
    Answers
    2

    Default

    its not refresh after sync()

  6. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    55
    Answers
    2

    Default

    I fount some solution for that.

    Ext.encode(Ext.pluck(Ext.getCmp('gridId').getStore().tree.root.childNodes[0].store.data.items,'data'))

    it is working fine. i am getting latest data as json format after delete a row.

    Thanks

Posting Permissions

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