Jun 04, 2016, 9:18 PM
[CLOSED] Issue with validate change on nested grid panel
Hi,
We are having an issue cell editing plugin inside a row expander, specifically the the validateedit listener, it is being called after the edit is made and not before the edit is made, also when the edit is made the incorrect values for the validation context are passed, this is, the newvalue and old value are always the same.
The issue is present in Ext 4.1, it was working correctly in 4.0
Here is a sample to reproduce the problem, to reproduce, add rows using the button on the panel, then expand the component and add rows to the inner grid, when try to edit the problem will be reproduced
We are having an issue cell editing plugin inside a row expander, specifically the the validateedit listener, it is being called after the edit is made and not before the edit is made, also when the edit is made the incorrect values for the validation context are passed, this is, the newvalue and old value are always the same.
The issue is present in Ext 4.1, it was working correctly in 4.0
Here is a sample to reproduce the problem, to reproduce, add rows using the button on the panel, then expand the component and add rows to the inner grid, when try to edit the problem will be reproduced
<%@ Page Language="C#" %>
<script runat="server">
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET Example</title>
</head>
<body>
<ext:ResourceManager runat="server" Theme="Triton" />
<ext:GridPanel
ID="GridPanel1"
runat="server"
Title="RowExpander"
Collapsible="true"
AnimCollapse="true"
Icon="Table"
Width="800"
Height="600">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="Add record to grid" Handler="var grid = this.up('grid'); grid.getStore().add(new (grid.getStore().getModel())());" />
</Items>
</ext:Toolbar>
</TopBar>
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Prop1" Type="String" />
<ext:ModelField Name="Prop2" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column runat="server" DataIndex="Prop1" Flex="1" />
<ext:Column runat="server" DataIndex="Prop2" Flex="10"/>
</Columns>
</ColumnModel>
<Plugins>
<ext:RowExpander>
<Component>
<ext:GridPanel
ID="GridPanel2"
runat="server"
Title="RowExpanded"
Icon="Table">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="Add record to grid" Handler="var grid = this.up('grid'); grid.getStore().add(new (grid.getStore().getModel())());" />
</Items>
</ext:Toolbar>
</TopBar>
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="Prop3" Type="Date" />
<ext:ModelField Name="Prop4" Type="Date" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column runat="server" DataIndex="Prop3">
<Editor>
<ext:DateField runat="server" />
</Editor>
</ext:Column>
<ext:Column runat="server" DataIndex="Prop4">
<Editor>
<ext:DateField runat="server" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<Plugins>
<ext:CellEditing>
<Listeners>
<ValidateEdit Handler="alert('should be called after edit, not before'); return true;" />
</Listeners>
</ext:CellEditing>
</Plugins>
</ext:GridPanel>
</Component>
</ext:RowExpander>
</Plugins>
</ext:GridPanel>
</body>
</html>
Regards.
Last edited by REB; Jun 04, 2016 at 9:20 PM.
Reason: Removed property from row expander not related to issue reported