PDA

View Full Version : [CLOSED] [4.2.2] Problem with proccesing event in the action column.



gruszks
10 Oct 2013, 3:57 AM
REQUIRED INFORMATION

Ext version tested:

Ext 4.2.2.1144

Browser versions tested against:

Chrome

Description:

When user click on the icon in the action column the ext fire two events instead of one only for the action handler.

Steps to reproduce the problem:

click on the edit icon in the action column

The result that was expected:

user in the console should only see the 'Edit []'.
the 'itemclick' event should no be triggered by the grid.

[U]The result that occurs instead:

user in the console see the 'Edit []' and the 'itemclick'

[U]Test Case:

https://fiddle.sencha.com/#fiddle/ti



Ext.create('Ext.data.Store', {
storeId:'employeeStore',
fields:['firstname', 'lastname', 'seniority', 'dep', 'hired'],
data:[
{firstname:"Michael", lastname:"Scott"},
{firstname:"Dwight", lastname:"Schrute"},
{firstname:"Jim", lastname:"Halpert"},
{firstname:"Kevin", lastname:"Malone"},
{firstname:"Angela", lastname:"Martin"}
]
});


Ext.create('Ext.grid.Panel', {
title: 'Action Column Demo',
store: Ext.data.StoreManager.lookup('employeeStore'),
columns: [
{text: 'First Name', dataIndex: 'firstname'},
{text: 'Last Name', dataIndex: 'lastname'},
{
xtype: 'actioncolumn',
width: 50,
items: [{
icon: 'edit.png',
tooltip: 'Edit',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
console.log("Edit " + rec.get('firstname'));
}
}]
}
],
listeners: {
itemclick: function() {
console.log('itemclick')
}
},
width: 250,
renderTo: Ext.getBody()
});



HELPFUL INFORMATION

Possible fix:

There is an issue in the Ext.view.Table. Here is diff of my changes:



=== modified file 'ext/ext-all-debug.js'
--- ext/ext-all-debug.js revid:patryk.gruszka
+++ ext/ext-all-debug.js 2013-10-10 11:39:06 +0000
@@ -109345,8 +109345,10 @@

result = me.fireEvent('uievent', type, me, cell, rowIndex, cellIndex, e, record, row);

- if ((result === false || me.callParent(arguments) === false) && selModel.onVetoUIEvent) {
- selModel.onVetoUIEvent(type, me, cell, rowIndex, cellIndex, e, record, row);
+ if ((result === false || me.callParent(arguments) === false)) {
+ if (selModel.onVetoUIEvent) {
+ selModel.onVetoUIEvent(type, me, cell, rowIndex, cellIndex, e, record, row);
+ }
return false;
}


Operating System:

OSX

Gary Schlosberg
10 Oct 2013, 10:42 AM
Thanks for the report! I'm not entirely sure this is a bug, but I can see your point so I have opened a bug in our bug tracker.

In the meantime, this thread might have a workaround:
http://www.sencha.com/forum/showthread.php?135821