Jul 18, 2016, 9:47 AM
Please help about combo removeall function
the removeall funtion for buttonchange not work,
also tried use in code behind:
also tried use in code behind:
this.Status.GetStore.RemoveAll();
still not work<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}
[DirectMethod]
protected void Update(object sender, DirectEventArgs e)
{
this.Status.Items.Add(new Ext.Net.ListItem("Stop","S"));
this.Status.GetStore().DataBind();
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v4 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Panel
ID="pnlPackCenter"
runat="server"
Layout="HBoxLayout"
BodyPadding="5">
<Defaults>
<ext:Parameter Name="margin" Value="0 5 0 0" Mode="Value" />
</Defaults>
<LayoutConfig>
<ext:HBoxLayoutConfig Align="Middle" Pack="Center" />
</LayoutConfig>
<Items>
<ext:ComboBox
ID="Status"
runat="server"
FieldLabel="Status"
AllowBlank="false"
ForceSelection="true"
>
<Items>
<ext:ListItem Text="New" Value="N" />
</Items>
</ext:ComboBox>
<ext:Button ID="ButtonChange" runat="server" Text="Change">
<DirectEvents>
<Click OnEvent="Update"
Before="#{Status}.getStore().removeAll();
#{Status}.clearValue();
"
Failure="
Ext.MessageBox.show({
title: 'Error',
msg: result.errorMessage,
buttons: Ext.MessageBox.OK,
icon: Ext.Msg.ERROR
});
" >
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="ButtonReset" runat="server" Text="Reset">
<Listeners>
<Click Handler="#{Status}.getStore().removeAll();
#{Status}.addItem('New','N');
" >
</Click>
</Listeners>
</ext:Button>
</Items>
</ext:Panel>
</form>
</body>
</html>
Last edited by geoffrey.mcgill; Jul 21, 2016 at 1:29 AM.