PDA

View Full Version : catching class of rel event in controller



Anthony.Hall
7 Jun 2012, 3:23 AM
I need to catch a rowclick in my controller

I have the following renderer



function renderProduct(value, p, r) { return Ext.String.format('<a href=# rel=editRow class=editRow>{0}</a>', r.data.CutterNumber);}


how can i catch this in my controller

I've tried the following but the class filter doesn't seem to work


'#cutterGrid .editRow':{ cellclick :this.onCutterSelectRow },

redraid
7 Jun 2012, 4:17 AM
Grid:


initComponent: function () {
var me = this;

me.addEvents('myeditrow');

me.listeners = {
el: {
delegate: 'a.editRow',
click: function (e) {
var record = me.view.getRecord(e.getTarget(me.view.itemSelector));
console.log('Record %o', record);
me.fireEvent('myeditrow', me, record);
e.preventDefault();
}
}
};

me.callParent(arguments);
}
Controller:


this.control({
grid xtype here: {
'myeditrow': function (grid, record) {
//
}
}
});

Anthony.Hall
7 Jun 2012, 5:15 AM
thanks, i'm getting the following error. Are you sure i can't just add in a class selector in the controller. Seems quite cumbersome to have to bind an event like this.

Cannot read property 'itemSelector' of undefined