PDA

View Full Version : grid cellmousedown event is creating error



amarnath1
17 Jan 2014, 2:29 AM
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.

scottmartin
17 Jan 2014, 7:25 AM
You may need to post your code, or have a look at:

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



Ext.onReady(function () {

Ext.create('Ext.data.Store', {
storeId : 'simpsonsStore',
fields : ['name', 'email', 'change'],
data : {'items' : [
{ 'name' : 'Lisa', 'email' : 'lisa@simpsons.com', 'change' : 100 },
{ 'name' : 'Bart', 'email' : 'bart@simpsons.com', 'change' : -20 },
{ 'name' : 'Homer', 'email' : 'homer@simpsons.com', 'change' : 23 },
{ 'name' : 'Marge', 'email' : 'marge@simpsons.com', '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');
});

});