PDA

View Full Version : ExtJS 4.0.2a CellEditing in Grid with actioncolumn



suamikim
10 Oct 2012, 10:45 PM
Hy there,

i have a grid with 2 columns (1 text-col & 1 action-col) with cell-editing enabled for the text-col. The action-col contains a button which should open an extended editor on click.

This is working in principle but i just discovered that it is not working if the cell-editor is open, the user already changed the value of the editor and clicks on the action-button (the cell-editor is closed but the click-handler of the action-button is not called).

If the user just opens the cell-editor and clicks on the action-button without changing the value of the editor or just clicks on the button without an open editor at all, everything is working as expected...

Working example: http://jsfiddle.net/4tp7M/

Ext.onReady(function() {
var grid, store;

store = Ext.create('Ext.data.Store', {
fields: ['name'],
data: { 'items': [
{ 'name': 'Lisa' },
{ 'name': 'Bart' },
{ 'name': 'Maggie' },
{ 'name': 'Homer' },
{ 'name': 'Marge' }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});

grid = Ext.create('Ext.grid.Panel', {
title: 'grid',
width: 200,
height: 200,

store: store,

columns: [{
header: 'Name',
dataIndex: 'name',
flex: 1,
field: 'textfield'
},{
xtype: 'actioncolumn',
width: 20,
align: 'right',
items: [{
iconCls: 'add-trigger',
handler: function() {
alert('Action column pressed!');
}
}]
}],

plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],

renderTo: Ext.getBody()
});
});

This is working with ExtJS 4.1.1 as you can see in my second working example (same code, only different framework-version): http://jsfiddle.net/4tp7M/1/

My first guess would be that any method that handles the blur-event of the editor just stops the click-event from bubbling and therefore the handler of the action-button is not called but i just can't find the right place...

Unfortunately i cannot change the framework by now so i need a fix for this in 4.0.2a and would really appreciate if someone could help me out with this or at least point me in the right direction.

Thanks,

mik

scottmartin
11 Oct 2012, 9:19 AM
Duplicate thread:
http://www.sencha.com/forum/showthread.php?245642

suamikim
11 Oct 2012, 3:04 PM
I know that the test-case is the same in both threads, but the issue isn't. Before opening this thread i thought about posting both questions in one thread but decided against it because i made the experience that it's more likely to get an answer if the question isn't too complexe and asking 2 questions in 1 thread obviously makes it more complex...

Therefore i really don't think that this is a duplicate and would appreciate any help!

Thanks

CalmDownMonkey
17 Jan 2013, 8:04 AM
We are having the exact same issue - did you ever find a solution?

We are using 4.1.1.

Edit: Our issue is slightly different in that we have two text field columns, rather than an action column, but the behaviour is the same - the blur event is swallowing the mouse click instead of focusing the other text field when you click on it.

suamikim
18 Jan 2013, 12:03 AM
The "solution" for me was to update the framework from 4.0.2a to 4.1.1. Sorry that I can't help no more but I'd suggest you to open a new thread and maybe asking the same question on stackoverflow if nobody can help you here within a few days...