PDA

View Full Version : 4.1.0 : grid reconfigure() + rowEditing plugin issue



bourbourg
6 Jun 2012, 11:59 PM
Hi,

When I use the reconfigure() function on a grid (with a rowediting plugin), then when I want to call and use the rowediting plugin, the fields don't match with the columns of the grid...



But with the 4.0.7 this works correctly :(

Anyone has a solution ?

Thanks,

Bourbourg ( bourbourg is a very tiny town in France ~o))

scottmartin
7 Jun 2012, 11:56 AM
Is the alignment of the editor the same before the reconfigure was issued?

Scott.

bourbourg
7 Jun 2012, 12:15 PM
no,
the alignment of the editor isn't the same before the reconfigure was issuedn before it is correct.

scottmartin
7 Jun 2012, 12:25 PM
Several comments:

Have you tried this on 4.1? There were many fixed to the grid from 4.07 where there were many issues with the virtual scrolling.

You are using a grouped header grid, with row editing and then using reconfigure?

Please provide a working example using one of our online examples that displays your problem. You can use an array store or json data for populating the grid.

Regards,
Scott.

ya@sherpa-solutions.com
17 Jan 2013, 10:54 AM
Using the latest release i could find (4.1.1a) i'm having the same issue. The RowEditing editors are not aligned to the grid columns after calling reconfigure().

You can toggle between the two use cases by commenting the last line (grid.reconfigure)
How can i avoid this issue or patch it somehow?



Ext.Loader.setConfig({
enabled: true
});


Ext.onReady(function () {
Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email'],
data:{'items':[
{ 'name': 'Lisa', "email":"lisa@simpsons.com"},
{ 'name': 'Bart', "email":"bart@simpsons.com"},
{ 'name': 'Homer', "email":"home@simpsons.com"},
{ 'name': 'Marge', "email":"marge@simpsons.com"}
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});


Ext.create('Ext.data.Store', {
storeId:'simpsonsStore2',
fields:['name', 'email', 'phone'],
data:{'items':[
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});


var grid = Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name', editor: 'textfield' },
{ text: 'Email', dataIndex: 'email', editor: 'textfield'}
],
height: 200,
width: 400,
plugins: [Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: true
})],
renderTo: Ext.getBody()
});




grid.reconfigure(Ext.data.StoreManager.lookup('simpsonsStore2'), [
{ text: 'Name', dataIndex: 'name', editor: 'textfield'},
{ text: 'Email', dataIndex: 'email', editor: 'textfield'},
{ text: 'Phone', dataIndex: 'phone', editor: 'textfield'}
]);


});

ya@sherpa-solutions.com
17 Jan 2013, 1:47 PM
Forcing the editor to be re-initialized seems to fix the issue. I have no idea what i'm doing so this method probably leaves instances/listeners lying around but thankful my pages don't have to live very long.

Something like this:



grid.rowEditing.editor = null;
grid.rowEditing.getEditor();

Daniil
19 Jul 2013, 7:16 AM
A JavaScript error occurs with ExtJS 4.2.1 in a similar scenario. Here is a bug report.
http://www.sencha.com/forum/showthread.php?268231

Thank you, ya@sherpa-solutions.com, setting .editor to null helps remedy the problem.

merabi@lider-bet.com
17 Sep 2014, 3:50 PM
I have the same layout problemafter reconfigure, row editing plugin at editing phase shows hidden column and layout is broken

Nandu007
25 Apr 2017, 2:21 AM
Forcing the editor to be re-initialized seems to fix the issue. I have no idea what i'm doing so this method probably leaves instances/listeners lying around but thankful my pages don't have to live very long.

Something like this:



grid.rowEditing.editor = null;
grid.rowEditing.getEditor();



This solution worked for me too..

Thanks,
Nandeesh N