PDA

View Full Version : 4.0.2 RowEditing; edit and beforeedit events do not work as described in API Doc



lasseok
12 Jun 2011, 8:58 AM
Only 1 of the 3 events work the way they are described in the API Doc:

(Working) validateedit:


var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: false,
listeners: {
validateedit: function(editor,e,opt){
console.log(editor); //Correct
console.log(e); //Correct
console.log(opt); //Correct (And actually defined)
}
}
});


edit event:


var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: false,
listeners: {
edit: function(editor,e,opt){
console.log(editor); //Contains the variables that should have been in the e var
console.log(e);
console.log(opt); //undefined
}
}
});


beforeedit event:


var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: false,
listeners: {
beforeedit: function(editor,e,opt){
console.log(editor); //Contains the variables that should have been in the e var
console.log(e);
console.log(opt); //undefined
}
}
});


The edit event example is like this in the Doc:



grid.on('edit', onEdit, this);

function onEdit(e) {
// execute an XHR to send/commit data to the server, in callback do (if successful):
e.record.commit();
};


And right below that is says:


Parameters

editor : Ext.grid.plugin.Editing
e : Object An edit event (see above for description)
options : Object
The options object passed to Ext.util.Observable.addListener.



Either the example is correct and the documentation wrong or it's the other way around. There's a similar problem with the beforeedit event.

bee
31 Oct 2011, 8:52 PM
I think this problem not yet solved in 407 and 4.1pr

pgagnon
30 Aug 2012, 7:02 AM
As of 4.0.7, you can only use one event at a time. I use a RowEditing plugin but it's has the same problem.



var myEditing = Ext.create('Ext.grid.plugin.RowEditing',
{clicksToEdit: 2}
);

myEditing.addListener('validateedit', function(editor, e) {
...
});



I use the validateedit event but I cannot use neither edit or beforeedit. If I comment out validateedit, the other event I have added kicks in.