Results 1 to 2 of 2

Thread: grid cellmousedown event is creating error

  1. #1
    Sencha Premium Member
    Join Date
    Nov 2013
    Posts
    24
    Answers
    1

    Default grid cellmousedown event is creating error

    I have grid cellmousedown event for my grid to navigate to the next page.But when i am clicking on any cell to trigger that event i got this error: Uncaught TypeError: Cannot call method 'apply' of undefined in chrome debugger. a console message is also printed

    I am unable to figure it out.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716

    Default

    You may need to post your code, or have a look at:

    Paste this code in our fiddle:
    https://fiddle.sencha.com/#home

    Code:
    Ext.onReady(function () {
    
        Ext.create('Ext.data.Store', {
            storeId : 'simpsonsStore',
            fields  : ['name', 'email', 'change'],
            data    : {'items' : [
                { 'name' : 'Lisa', 'email'  : '[email protected]', 'change' : 100  },
                { 'name' : 'Bart', 'email'  : '[email protected]', 'change' : -20  },
                { 'name' : 'Homer', 'email' : '[email protected]', 'change' : 23   },
                { 'name' : 'Marge', 'email' : '[email protected]', 'change' : -11   }
            ]},
            proxy   : {
                type   : 'memory',
                reader : {
                    type : 'json',
                    root : 'items'
                }
            }
        });
    
        var grid = Ext.create('Ext.grid.Panel', {
            title    : 'Simpsons',
            store    : Ext.data.StoreManager.lookup('simpsonsStore'),
            selModel : {
                selType: 'cellmodel'
            },
            columns  : [
                { header : 'Name', dataIndex : 'name', editor : { xtype : 'textfield' } },
                { header : 'Email', dataIndex : 'email', flex : 1, editor : { xtype : 'textfield' } },
                { header : 'Change', dataIndex : 'change', editor : { xtype : 'textfield' } }
            ],
            height   : 200,
            width    : 400,
            renderTo : Ext.getBody()
        });
        
        grid.on('cellmousedown', function(grid, td, cellIndex, record, tr, rowIndex, e ) { 
            console.log('cellmousedown');
        });    
    
    });

Posting Permissions

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