PDA

View Full Version : [CLOSED] [4.2.1 gpl] Grid column setEditor in beforeEdit handler of RowEditing causes error



nlpack
20 Oct 2013, 2:21 AM
[4.2.1 GA] Grid column setEditor in beforeEdit handler of RowEditing causes error, but with ext-4.2.0-gpl.zip(ext-4.2.0.663) is work fine.


REQUIRED INFORMATION

Ext version tested:

Ext 4.2.1 gpl

Browser versions tested against:

firefox 16.0.1
Mozilla Firefox for Ubuntu
canonical-1.0

DOCTYPE tested against:

<!DOCTYPE html>

Description:

A grid column's setEditor call in a beforeEdit handler of a RowEditing causes a JavaScript error.



TypeError: editor.removeField is not a function









It worked before (not sure about the version).
It works with a CellEditing

Steps to reproduce the problem:

Double click on any cell to start editing

The result that was expected:

A row editor appears with a NumberField editor in the clicked column

The result that occurs instead:

A JavaScript error occurs.



TypeError: editor.removeField is not a function












TestCase



<html>
<head>
<title>Grid column's setEditor call in a beforeEdit handler causes a JavaScipt error</title>

<link rel="stylesheet" href="../resources/css/ext-all.css" />

<script src="../ext-all-debug.js"></script>

<script>
Ext.onReady(function () {
Ext.create("Ext.grid.Panel", {
renderTo: Ext.getBody(),
store: {
fields: [{
name: "test1"
}, {
name: "test2"
}, {
name: "test3"
}],
data: [{
test1: "1",
test2: "2",
test3: "3"
},
{
test1: "4",
test2: "5",
test3: "6"
}, {
test1: "7",
test2: "8",
test3: "9"
}]
},
columns: [{
text: "Test1",
dataIndex: "test1",
editor: "textfield"
}, {
text: "Test2",
dataIndex: "test2",
editor: "textfield"
}, {
text: "Test3",
dataIndex: "test3",
editor: "textfield"
}],
plugins: {
ptype: "rowediting", // it works with "cellediting"
listeners: {
beforeEdit: function (editingPlugin, e) {
e.column.setEditor(Ext.create("Ext.form.field.Number", {}));
}
}
}
});
});
</script>
</head>
<body>

</body>
</html>

evant
20 Oct 2013, 12:06 PM
This issue is already fixed in 4.2.2.