-
6 Jul 2012 9:58 AM #1
Ext.grid.plugin.CellEditing not working in 4.1 but working in 4.0.7
Ext.grid.plugin.CellEditing not working in 4.1 but working in 4.0.7
Hi!
This example creates a grid with editable properties specified by input data.
http://jsfiddle.net/kk4vA/3/
It works fine on ExtJs 4.0.7 but I switched to version 4.1 and it doesn't fire editing events.
It doesn't fire any javascript exception as well..
Can you figure out why? Is it a bug or something changed?
-
6 Jul 2012 10:46 AM #2
Have a look at your grid configuration ... columns/fields/data
To verify the events work as expected, please check the following:
Scott.Code:Ext.onReady(function() { Ext.create('Ext.data.Store', { storeId:'simpsonsStore', fields:['name', 'email', 'change', 'check'], data:{'items':[ { 'name': 'Lisa', "email":"lisa@simpsons.com", "change":100 }, { 'name': 'Bart', "email":"bart@simpsons.com", "change":-20 }, { 'name': 'Homer', "email":"home@simpsons.com", "change":23 }, { 'name': 'Marge', "email":"marge@simpsons.com", "change":-11 } ]}, proxy: { type: 'memory', reader: { type: 'json', root: 'items' } } }); var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1, listeners: { edit: function(){ console.log('edit'); //return false; }, beforeedit: function(){ console.log('beforeedit'); //return false; } } }); Ext.create('Ext.grid.Panel', { title: 'Simpsons', store: Ext.data.StoreManager.lookup('simpsonsStore'), columns: [{ header: 'Name', dataIndex: 'name', editor: { xtype: 'textfield' } }, { header: 'Email', dataIndex: 'email', editor: { xtype: 'textfield' }, flex: 1 }, { header: 'Change', dataIndex: 'change', editor: { xtype: 'numberfield' } }], height: 200, width: 400, plugins: [cellEditing], renderTo: Ext.getBody() }); });
-
7 Jul 2012 4:46 AM #3
The problem is that the there is no editor initially defined on the column. It's an efficiency check because there's no point going through the initialization if there's no editor. The solution is to put a placeholder editor by default.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
8 Jul 2012 11:53 PM #4
[Solved] Ext.grid.plugin.CellEditing not working in 4.1 but working in 4.0.7
[Solved] Ext.grid.plugin.CellEditing not working in 4.1 but working in 4.0.7
Thanks!
Here is a working version, for those who are checking for the same problem:
http://jsfiddle.net/kk4vA/4/
Changed:
breforeedit Event, from:
beforeedit: function(e)
to
beforeedit: function(editor, e, eOpts)
and added editor: { xtype: 'textfield' }, in columns properties inside pnlPropertiesTest
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote