Results 1 to 2 of 2

Thread: [4.2.1.789] tabbing through grid columns in cell editing mode

  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    4
    Vote Rating
    2
      0  

    Default [4.2.1.789] tabbing through grid columns in cell editing mode

    For a grid with plugin of Ext.grid.plugin.CellEditing, if clicks on a cell to start editing, then hitting the tab key will jump to the last cell instead of the next adjacent cell. It was working on Ext 4.1.3.

    The override below we figured actually works:
    Code:
    Ext.override(Ext.selection.RowModel, {
      onEditorTab: function(editingPlugin, e) {
        var me = this,
          view = me.views[0],
          record = editingPlugin.getActiveRecord(),
          header = editingPlugin.getActiveColumn(),
          position = view.getPosition(record, header),
          direction = e.shiftKey ? 'left' : 'right';
    
        do {
          position  = view.walkCells(position, direction, e, me.preventWrap);
        } while(position && !view.headerCt.getHeaderAtIndex(position.column).getEditor());
    
        if (position) {
          editingPlugin.startEditByPosition(position);
        }
      }
    });

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,154
    Vote Rating
    247
      0  

    Default

    Can you post a test case to demonstrate the issue? I used the below code and clicked in the first cell to begin the edit and tabbed and the next cell was selected for edit.

    Code:
    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name', 'email', 'phone'],
        data:{'items':[
            {"name":"Lisa", "email":"lisa@simpsons.com", "phone":"555-111-1224"},
            {"name":"Bart", "email":"bart@simpsons.com", "phone":"555-222-1234"},
            {"name":"Homer", "email":"home@simpsons.com", "phone":"555-222-1244"},
            {"name":"Marge", "email":"marge@simpsons.com", "phone":"555-222-1254"}
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
    
    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [
            {header: 'Name',  dataIndex: 'name', editor: 'textfield'},
            {header: 'Email', dataIndex: 'email', flex:1,
                editor: {
                    xtype: 'textfield',
                    allowBlank: false
                }
            },
            {header: 'Phone', dataIndex: 'phone'}
        ],
        selType: 'cellmodel',
        plugins: [
            Ext.create('Ext.grid.plugin.CellEditing', {
                clicksToEdit: 1
            })
        ],
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });

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
  •