PDA

View Full Version : [CLOSED] directevent Change event not execute?



tobros
Aug 29, 2013, 1:36 AM
When the combobox load first , and select the first item , then I want to do somthing.
and when select one item of combobox , I want to do the same thing.
what event to apply?
I try change event of directevent, but not do anything.
please see test case below


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm6.aspx.cs" Inherits="TobrosCWT.test.WebForm6" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script runat="server">
protected void clickme(object sender, DirectEventArgs e)
{

for (int i = 0; i < 3; i++)
{
cb_sheet.AddItem("text" + i, i);

}
cb_sheet.Select(0);
}

protected void SheetChange(object sender, DirectEventArgs e)
{
X.Msg.Alert("ssss", "ddfff");
}
protected void SheetAftRndr(object sender, DirectEventArgs e)
{
X.Msg.Alert("ssss111", "ddfff111");
}

</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager runat="server"></ext:ResourceManager>
<ext:Window runat="server" Title="导入excel" ID="w_imp_excel" Hidden="True" Plain="true" Layout="AnchorLayout" Width="320" Modal="True">

<Items>

<ext:Container runat="server" Layout="HBoxLayout">
<LayoutConfig>
<ext:HBoxLayoutConfig Pack="Center" />
</LayoutConfig>
<Items>
<ext:Button runat="server" Text="click me">
<DirectEvents>
<Click OnEvent="clickme"></Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:Container>

<ext:Container runat="server" Layout="HBoxLayout">
<LayoutConfig>
<ext:HBoxLayoutConfig Pack="Center" />
</LayoutConfig>
<Items>
<ext:Label ID="Label1" runat="server" Text="凭证类别编码:"></ext:Label>
<ext:ComboBox ID="cb_sheet" runat="server" InputWidth="60">
<DirectEvents>
<Change OnEvent="SheetChange"></Change>
<AfterRender OnEvent="SheetAftRndr"></AfterRender>
</DirectEvents>
</ext:ComboBox>
<ext:ComboBox ID="ComboBox2" runat="server" InputWidth="120"></ext:ComboBox>
</Items>
</ext:Container>
<ext:Container runat="server" Layout="HBoxLayout">
<LayoutConfig>
<ext:HBoxLayoutConfig Pack="Center" />
</LayoutConfig>
<Items>
<ext:Label ID="Label2" runat="server" Text="凭证类别名称:"></ext:Label>
<ext:ComboBox ID="ComboBox3" runat="server" InputWidth="60"></ext:ComboBox>
<ext:ComboBox ID="ComboBox4" runat="server" InputWidth="120"></ext:ComboBox>
</Items>

</ext:Container>



</Items>
<Buttons>
<ext:Button runat="server" Text="导入"></ext:Button>
</Buttons>
</ext:Window>
<ext:GridPanel runat="server">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="show window">
<Listeners>
<Click Handler="#{w_imp_excel}.show();"></Click>
</Listeners>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
</ext:GridPanel>
</form>
</body>
</html>

tobros
Aug 29, 2013, 2:39 AM
sorry, forgot show the alert


X.Msg.Alert("SheetChange", "SheetChange").Show();

you can close the thread.