Results 1 to 3 of 3

Thread: Ext.grid.plugin.CellEditing blur Event?

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    59
    Answers
    2

    Default Answered: Ext.grid.plugin.CellEditing blur Event?

    Hi,
    I'm using the Ext.grid.plugin.CellEditing - plugin on an Ext.tree.Panel.

    ExtJS version: "4.0.7"

    the plugin setup looks like this:
    PHP Code:
    this._cellEditor Ext.create('Ext.grid.plugin.CellEditing', {
        
    clicksToEdit2,
        
    listeners: {
            
    beforeEdit: function (eeOpts)
            {
                
    console.log('beforeEdit');
            },
            
    edit: function (theEditoreeOpts)
            {
                
    console.log('edit');
            },
            
    validateedit: function (editore)
            {
                
    console.log('validateedit');
            }
        }, 
    the editable column looks like this:
    PHP Code:
    columns : [
                            {
                                
    xtype     'treecolumn'//this is so we know which column will show the tree
                                
    text      'myEditableColumn',
                                
    flex      2,
                                
    sortable  true,
                                
    dataIndex 'text'
                                
    editor    : {
                                    
    xtype'textfield',
                                    
    allowBlank false
                                
    }
                            }
                        ], 
    My Problem:
    If I start editing, leave the Input-Field blank and click somewhere, the editor closes and none of the Events get fired!

    What do I want:
    If the User leaves the Input-Field blank, an error notification should show up that he has to input at least 3 characters.

    Please help ... I'm struggling around with this problem since a few Days!
    Also tried 'allowBlur:false' but this doesn't help though this is a property of Ext.Editor and Ext.grid.plugin.CellEditing is extended from Ext.Editor.
    new to ExtJS

  2. I have some plugin overriding becouse it not working well. Here it is:
    PHP Code:
    Ext.define('Ext.CellEditing', {
      
    extend'Ext.grid.plugin.CellEditing',
      
    alias'widget.cellediting',

      
    getEditingContext: function(recordcolumnHeader) {
        var 
    me this,
          
    grid me.grid,
          
    store grid.store,
          
    rowIdx,
          
    colIdx,
          
    view grid.getView(),
          
    value;

        if (
    Ext.isNumber(record)) {
          
    rowIdx record;
          
    record store.getAt(rowIdx);
        } else {
          if (
    store.indexOf) {
            
    rowIdx store.indexOf(record);
          } else {
            if (
    columnHeader.ownerCt.lockableInjected) {
                if (
    columnHeader.locked) {
                    
    rowIdx view.lockedView.indexOf(view.lockedView.getNode(record));
                } else {
                    
    rowIdx view.normalView.indexOf(view.normalView.getNode(record));
                }
            } else {
                
    rowIdx view.indexOf(view.getNode(record));
            }
          }
        }
        if (
    Ext.isNumber(columnHeader)) {
          
    colIdx columnHeader;
          
    columnHeader grid.headerCt.getHeaderAtIndex(colIdx);
        } else {
          
    colIdx columnHeader.getIndex();
        }

        
    value record.get(columnHeader.dataIndex);
        return {
          
    gridgrid,
          
    recordrecord,
          
    fieldcolumnHeader.dataIndex,
          
    valuevalue,
          
    rowview.getNode(rowIdx),
          
    columncolumnHeader,
          
    rowIdxrowIdx,
          
    colIdxcolIdx
        
    };
      }
    }); 
    Why do you use _? this._cellEditor
    In tree.Panel config:
    PHP Code:
         pluginsExt.create('Ext.CellEditing', {
              
    clicksToEdit1,
              
    autoCancelfalse,
              
    listeners: {
                
    'beforeedit': function(obj) {},
                
    'afteredit': function(editorobj) {}
              }
        }); 
    Have a nice day!

  3. #2
    Sencha User
    Join Date
    Oct 2011
    Location
    Ukraine
    Posts
    154
    Answers
    11

    Default Hi

    I have some plugin overriding becouse it not working well. Here it is:
    PHP Code:
    Ext.define('Ext.CellEditing', {
      
    extend'Ext.grid.plugin.CellEditing',
      
    alias'widget.cellediting',

      
    getEditingContext: function(recordcolumnHeader) {
        var 
    me this,
          
    grid me.grid,
          
    store grid.store,
          
    rowIdx,
          
    colIdx,
          
    view grid.getView(),
          
    value;

        if (
    Ext.isNumber(record)) {
          
    rowIdx record;
          
    record store.getAt(rowIdx);
        } else {
          if (
    store.indexOf) {
            
    rowIdx store.indexOf(record);
          } else {
            if (
    columnHeader.ownerCt.lockableInjected) {
                if (
    columnHeader.locked) {
                    
    rowIdx view.lockedView.indexOf(view.lockedView.getNode(record));
                } else {
                    
    rowIdx view.normalView.indexOf(view.normalView.getNode(record));
                }
            } else {
                
    rowIdx view.indexOf(view.getNode(record));
            }
          }
        }
        if (
    Ext.isNumber(columnHeader)) {
          
    colIdx columnHeader;
          
    columnHeader grid.headerCt.getHeaderAtIndex(colIdx);
        } else {
          
    colIdx columnHeader.getIndex();
        }

        
    value record.get(columnHeader.dataIndex);
        return {
          
    gridgrid,
          
    recordrecord,
          
    fieldcolumnHeader.dataIndex,
          
    valuevalue,
          
    rowview.getNode(rowIdx),
          
    columncolumnHeader,
          
    rowIdxrowIdx,
          
    colIdxcolIdx
        
    };
      }
    }); 
    Why do you use _? this._cellEditor
    In tree.Panel config:
    PHP Code:
         pluginsExt.create('Ext.CellEditing', {
              
    clicksToEdit1,
              
    autoCancelfalse,
              
    listeners: {
                
    'beforeedit': function(obj) {},
                
    'afteredit': function(editorobj) {}
              }
        }); 
    Have a nice day!

  4. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    59
    Answers
    2

    Default

    Romick, thanks A LOT!
    Now i get an notification via the 'afteredit' event, if I click somewhere in my Tree.
    But: I still get no notification if i click outside the Tree-containing window.
    Any Idea?

    I'm using this._cellEditor because this is all inside a display() function of a class.
    I'm not following the flash-like-approach myclass extends sprite / myclass extend: 'Ext.Window'.

    Best regards
    new to ExtJS

Posting Permissions

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