Results 1 to 2 of 2

Thread: Editor grid with infinite scroll

  1. #1
    Sencha User
    Join Date
    Apr 2007
    Posts
    39
    Answers
    2

    Default Answered: Editor grid with infinite scroll

    I have a simple editor grid which has infinite scrolling enabled on it -

    PHP Code:
    Ext.Loader.setConfig({
        
    enabled:        true,
        
    disableCachingtrue,
    });


    Ext.onReady(function() {
        
    Ext.tip.QuickTipManager.init();
      
      
    Ext.define('Contact', {
        
    extend  'Ext.data.Model',
        
        
    fields  : [ 'id''name''company' ],
        
        
    proxy  : {
          
    type  'rest',
          
    url    '/contacts',
          
    reader  : {
            
    root      'value',
            
    type      'json',
            
    successProperty  'success'
          
    }
        }
      });
      
      var 
    store  Ext.create('Ext.data.Store', {
        
    model    'Contact',
        
        
    buffered  true,
        
        
    pageSize  50,
        
    leadingBufferZone  100,
        
        
    autoLoad  true,
        
    autoSync  true
        
      
    });
      
      var 
    cellediting  Ext.create('Ext.grid.plugin.CellEditing', {
        
    clicksToEdit  2
      
    });
      
      var 
    grid  Ext.create('Ext.grid.Panel', {
        
        
    title    'Editor Grid with Infinite Scroll',
        
        
    plugins    : [ cellediting ],

        
    store    store,
            
        
    columns  : [
          {
            
    header    'ID',
            
    dataIndex  'id'
          
    },
          {
            
    header    'Name',
            
    dataIndex  'name',
            
    editor    : {
              
    xtype  'textfield'
            
    }
          },
          {
            
    header    'Company',
            
    dataIndex  'company',
            
    editor    : {
              
    xtype  'textfield'
            
    }
          }
        ],

        
    tbar    : [
          {
             
    text    'Add Record'
            
    ,handler  : function(){
              var 
    record = new Contact({
                
    name  'New Contact'
              
    });
              
              
    store.insert(0record);
            }
          },
          
    '-',
          {
             
    text    'Delete Record'
            
    ,handler  : function(){
              var 
    record grid.getSelectionModel().getLastSelected();
              
              if (
    record)
                
    store.remove(record);
            }
          },
          
    '->',
          {
             
    text    'Refresh'
            
    ,handler  : function(){
              
    store.reload();
            }
          }
        ]
      });


      var 
    viewport  Ext.create('Ext.container.Viewport', {
        
    layout  'fit',
        
        
    items  : [ grid ]
        
      });

    }); 
    If I try to add, edit or delete a record, I get the following error -
    Code:
    this.data.filterBy is not a function
    When I disable the infinite scrolling by commenting out "buffered: true", everything seems to work fine.

    How do I resolve this issue? I've looked everywhere and tried everything but just am not able to figure out how to approach this.

    This code works fine with Extjs 4.1.1a but fails in Extjs 4.2.1.744 and 4.2.1.883

    Any suggestions would be great, as I'm at the end of my wits about this.

    Thanks in advance.

  2. Adding and removing records aren't currently supported on buffered stores. The functionality seems to have been removed after 4.1. You should still be able to use a buffered renderer if that helps.

  3. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Adding and removing records aren't currently supported on buffered stores. The functionality seems to have been removed after 4.1. You should still be able to use a buffered renderer if that helps.

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
  •