Hybrid View

  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    15
    Vote Rating
    2
    navr84 is on a distinguished road

      0  

    Default Buffered Store with editor grid.

    Buffered Store with editor grid.


    We have been using version 4.1.1 and are migrating to 4.2.0.663. We have editor grids with buffered stores which contain large volume of data. The editor grids are similar to the row-editing example(except that it uses buffered store). But the add functionality for the grid has stopped after migration and it raises an error
    Ext.Error: insert operation not supported into buffered Store.

    HTML Code:
    var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
            clicksToMoveEditor: 1,
            autoCancel: false
        });
    
        // create the grid and specify what field you want
        // to use for the editor at each column.
        var grid = Ext.create('Ext.grid.Panel', {
            store: store,
            columns: [{
                header: 'Name',
                dataIndex: 'name',
                flex: 1,
                editor: {
                    // defaults to textfield if no xtype is supplied
                    allowBlank: false
                }
            }, {
                header: 'Email',
                dataIndex: 'email',
                width: 160,
                editor: {
                    allowBlank: false,
                    vtype: 'email'
                }
            }, {
                xtype: 'datecolumn',
                header: 'Start Date',
                dataIndex: 'start',
                width: 90,
                editor: {
                    xtype: 'datefield',
                    allowBlank: false,
                    format: 'm/d/Y',
                    minValue: '01/01/2006',
                    minText: 'Cannot have a start date before the company existed!',
                    maxValue: Ext.Date.format(new Date(), 'm/d/Y')
                }
            }, {
                xtype: 'numbercolumn',
                header: 'Salary',
                dataIndex: 'salary',
                format: '$0,0',
                width: 90,
                editor: {
                    xtype: 'numberfield',
                    allowBlank: false,
                    minValue: 1,
                    maxValue: 150000
                }
            }, {
                xtype: 'checkcolumn',
                header: 'Active?',
                dataIndex: 'active',
                width: 60,
                editor: {
                    xtype: 'checkbox',
                    cls: 'x-grid-checkheader-editor'
                }
            }],
            renderTo: 'editor-grid',
            width: 600,
            height: 400,
            title: 'Employee Salaries',
            frame: true,
            tbar: [{
                text: 'Add Employee',
                iconCls: 'employee-add',
                handler : function() {
                    rowEditing.cancelEdit();
    
                    // Create a model instance
                    var r = Ext.create('Employee', {
                        name: 'New Guy',
                        email: 'new@sencha-test.com',
                        start: Ext.Date.clearTime(new Date()),
                        salary: 50000,
                        active: true
                    });
    
                    store.insert(0, r);
                    rowEditing.startEdit(0, 0);
                }
            }],
            plugins: [rowEditing],
    });
    Please advise on what is the approach to be followed.

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Posts
    15
    Vote Rating
    2
    navr84 is on a distinguished road

      0  

    Default


    Does anyone have any workaround for this?

  3. #3
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    105
    Vote Rating
    5
    pscanlon1 is on a distinguished road

      0  

    Default


    What does your stores configuration look like?

  4. #4
    Sencha User
    Join Date
    Apr 2011
    Posts
    15
    Vote Rating
    2
    navr84 is on a distinguished road

      0  

    Default


    Our store config is as given below :
    PHP Code:
    var store Ext.create('Ext.data.Store',{            
    model 'Qreda.model.Emp',                
    remoteSort true,                
    remoteFilter true,               
     
    pageSize 100,                
    buffered true}); 

    And we add an empty record to the grid for editing as given below :
    PHP Code:
    var label Ext.create('Qreda.model.Emp', {});        
    var 
    gridPanel button.up('gridpanel');       
    var 
    editorPlugin gridPanel.getPlugin('gridroweditor'); 
    editorPlugin.cancelEdit();        
    gridPanel.getStore().insert(0label);       
    if (
    editorPlugin) {           
     
    editorPlugin.startEdit(label0);    


  5. #5
    Sencha User
    Join Date
    Apr 2011
    Posts
    15
    Vote Rating
    2
    navr84 is on a distinguished road

      0  

    Default


    Can anybody please update on what is the suggested approach to be followed in this case?

  6. #6
    Sencha User
    Join Date
    May 2014
    Posts
    4
    Vote Rating
    0
    nathantp is on a distinguished road

      0  

    Default


    Has anyone found a solution to this? I'm having a similar issue

  7. #7
    Ext JS Premium Member
    Join Date
    Nov 2008
    Posts
    103
    Vote Rating
    5
    andrej_marincic is on a distinguished road

      0  

    Default


    I'm having the same isue here. Hopefully sencha guys will listen to our prayers