May 27, 2011, 12:12 AM
Cancel insertion or editing of gridpanel
Hi
I have a gridpanel that displays a window to insert new record. It's working.
But I have a cancel button only closes the window, I need data gridpanel be canceled by clicking this button
Thanks
Following partial code:
I have a gridpanel that displays a window to insert new record. It's working.
But I have a cancel button only closes the window, I need data gridpanel be canceled by clicking this button
Thanks
Following partial code:
<ext:Window
ID="CadastroProduto"
runat="server"
Icon="Group"
Title="Cadastro de Produtos"
Width="400"
Height="400"
AutoShow="false"
Modal="true"
Hidden="true"
Layout="Fit">
<Items>
<ext:FormPanel ID="FormPanel1" runat="server" Title="Form Panel" Padding="5" ButtonAlign="Right">
<Items>
<ext:TextField ID="COD_PRODUTO" DataIndex="COD_PRODUTO" runat="server" FieldLabel="Código" AnchorHorizontal="95%" />
<ext:TextField ID="DESCRICAO" DataIndex="DESCRICAO" runat="server" FieldLabel="Descrição" AnchorHorizontal="95%" />
<ext:TextField ID="PRECO_CUSTO" DataIndex="PRECO_CUSTO" runat="server" FieldLabel="Preço Custo" AnchorHorizontal="95%" />
<ext:TextField ID="PRECO_VENDA" DataIndex="PRECO_VENDA" runat="server" FieldLabel="Preço Venda" AnchorHorizontal="95%" />
<ext:ComboBox ID="COD_MARCA2" runat="server" DataIndex="COD_MARCA" StoreID="Store2" TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All" DisplayField="DESCRICAO" ValueField="COD_MARCA" EmptyText="Carregando..." ValueNotFoundText="Carregando..."/>
</Items>
<Buttons>
<ext:Button ID="Button10" runat="server" Text="Salvar">
<Listeners>
<Click Handler="#{FormPanel1}.getForm().updateRecord(#{GridPanel1}.getSelectionModel().getSelected());#{GridPanel1}.save();#{CadastroProduto}.hide()" />
</Listeners>
</ext:Button>
<ext:Button ID="Button4" runat="server" Text="Cancelar">
<Listeners>
<Click Handler="#{CadastroProduto}.hide();#{GridPanel1}.cancelRecord()" />
</Listeners>
</ext:Button>
</Buttons>
</ext:FormPanel>
</Items>
</ext:Window>