Jul 16, 2015, 8:36 AM
GridPanel autoheight remove record prompt error
Hi,
When using command handler to remove record in the gridPanel (Store.remove(record)),
Runtime error:'Ext.fly(....)' is null or not an object prompts.
But no error prompts when the autoheight = false.
Below is a sample to reproduce the issue, first click the "add" button to add a row, and click the "cross" icon in the command column and the error prompts.
Any help is appreciated. Thanks in advance.
When using command handler to remove record in the gridPanel (Store.remove(record)),
Runtime error:'Ext.fly(....)' is null or not an object prompts.
But no error prompts when the autoheight = false.
Below is a sample to reproduce the issue, first click the "add" button to add a row, and click the "cross" icon in the command column and the error prompts.
Any help is appreciated. Thanks in advance.
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Test</title>
<script type="text/javascript">
var deletePA = function (grid, command, record, row) {
StorePA.remove(record);
};
var addPA = function (cuid, displayName) {
StorePA.addRecord({ Cuid: cuid, DisplayName: displayName, Phone: "" });
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager ID="ResourceManager" runat="server" Theme="Slate">
</ext:ResourceManager>
<ext:Store ID="StorePA" runat="server">
<Reader>
<ext:JsonReader IDProperty="Cuid">
<Fields>
<ext:RecordField Name="Cuid" />
<ext:RecordField Name="DisplayName" />
<ext:RecordField Name="Phone" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:Panel ID="PanelMain" runat="server">
<Items>
<ext:GridPanel ID="GridPA" runat="server" StoreID="StorePA" ClicksToEdit="1" AutoHeight="true">
<TopBar>
<ext:Toolbar>
<Items>
<ext:Button Text="Add">
<Listeners>
<Click Handler="addPA('test','test');" />
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<ColumnModel runat="server">
<Columns>
<ext:Column Header="Name" DataIndex="DisplayName">
</ext:Column>
<ext:Column Header="Phone" DataIndex="Phone">
</ext:Column>
<ext:ImageCommandColumn Width="25">
<Commands>
<ext:ImageCommand Icon="Cross" CommandName="delete" ToolTip-Title="Remove Project Co-ordinator" />
</Commands>
</ext:ImageCommandColumn>
</Columns>
</ColumnModel>
<Listeners>
<Command Handler="deletePA(this, command, record, rowIndex);" />
</Listeners>
</ext:GridPanel>
</Items>
</ext:Panel>
</form>
</body>
</html>