May 12, 2017, 5:43 PM
[OPEN] [#1476] [4.2.0] GridPanel CellEditing error when Column has Command
When using the CellEditing plugin and editing a column in a grid that contains an ImageCommand, I am getting a javascript error and the edit fails. The error is below as well as a simple example to recreate the issue. Just try to edit the grid and you should see the error. If I remove the ImageCommand the cell editing works fine.
Uncaught TypeError: Cannot read property 'tdCls' of null
at constructor.cellCommandRenderer (ext.axd?v=4.2.0:15330)
at constructor.renderer (ext.axd?v=4.2.0:4355)
at Object.callback (ext.axd?v=4.2.0:5334)
at constructor.handleUpdate (ext.axd?v=4.2.0:130021)
at constructor.onUpdate (ext.axd?v=4.2.0:113941)
at constructor.fire (ext.axd?v=4.2.0:11880)
at constructor.doFireEvent (ext.axd?v=4.2.0:12476)
at constructor.prototype.doFireEvent (ext.axd?v=4.2.0:35965)
at constructor.fireEventArgs (ext.axd?v=4.2.0:12382)
at constructor.fireEvent (ext.axd?v=4.2.0:12357)
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.BindData();
}
}
private void BindData()
{
Store store = this.GridPanel1.GetStore();
store.DataSource = this.Data;
store.DataBind();
}
private object[] Data
{
get
{
DateTime now = DateTime.Now;
return new object[]
{
new object[] { "3m Co"}
};
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<link href="/resources/css/examples.css" rel="stylesheet" />
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel
ID="GridPanel1"
runat="server"
Title="Array Grid"
Width="400" Height="600">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="company" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Company" DataIndex="company" Flex="1">
<Editor>
<ext:TextField runat="server"></ext:TextField>
</Editor>
<Commands>
<ext:ImageCommand CommandName="Clear" Icon="Delete"></ext:ImageCommand>
</Commands>
</ext:Column>
</Columns>
</ColumnModel>
<Plugins>
<ext:CellEditing runat="server"></ext:CellEditing>
</Plugins>
</ext:GridPanel>
</form>
</body>
</html>
Last edited by fabricio.murta; May 12, 2017 at 6:18 PM.