PDA

View Full Version : In Extjs 4 (MVC) Grid RowEditing Plugin working only once After refreshing page.



kanchan@rhytha.co.in
24 Aug 2012, 5:56 AM
Hi,
I have implemented RowEditing plugins in grid and in "listeners" i created "beforeedit" event.
But it work's only once after refreshing page. it's dosen't print my console.log on next edit.

Code :-

var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1
,autoCancel: false
,listeners: {
beforeedit: function(editor, e, eOpts) {
console.log(editor);
}
}
});

scottmartin
25 Aug 2012, 3:07 PM
This fires each time: (4.1.1)



Ext.create('Ext.data.Store', {
storeId : 'simpsonsStore',
fields : ['name', 'email', 'change'],
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 rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: false,
listeners: {
beforeedit: function(editor, e, eOpts) {
console.log(editor);
}
}
});

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', flex : 1, editor: { xtype: 'textfield' } },
{ header : 'Change', dataIndex : 'change', editor: { xtype: 'textfield' } }
],
height : 200,
width : 400,
renderTo : Ext.getBody(),

plugins : [ rowEditing ]

});?


Scott.