Aug 01, 2013, 6:40 AM
[CLOSED] why keyup event not be triggered?
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm8.aspx.cs" Inherits="TobrosCWT.pages.pingzheng.WebForm8" %>
<%@ Register TagPrefix="a" Namespace="System.Data.Entity.Migrations.Model" Assembly="EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" %>
<!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>
</head>
<script runat="server">
public class Company
{
public int ID { get; set; }
public string Name { get; set; }
public string Cate { get; set; }
}
public List<Company> GetData()
{
return new List<Company>
{
new Company{ID = 1,Name = "comp1",Cate = "餐饮"},
new Company{ID = 2,Name = "comp2",Cate = "电子"},
};
}
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.BindData();
}
}
private void BindData()
{
this.store1.DataSource = GetData();
this.store1.DataBind();
}
private static bool b = true;
protected void clickme(object sender, DirectEventArgs e)
{
if (b)
{
this.cc_bz.Hidden = false;
b = false;
}
else
{
this.cc_bz.Hidden = true;
b = true;
}
}
protected void selectme(object sender, DirectEventArgs e)
{
X.Msg.Alert("sss","ddd").Show();
}
</script>
<body>
<form id="form1" runat="server">
<ext:ResourceManager runat="server"></ext:ResourceManager>
<ext:GridPanel runat="server" ID="gridpanel1" Height="100">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="show the column">
<DirectEvents>
<Click OnEvent="clickme"></Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Store>
<ext:Store runat="server" ID="store1">
<Model>
<ext:Model runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="ID" Type="Int" />
<ext:ModelField Name="Name" />
<ext:ModelField Name="Cate"></ext:ModelField>
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column runat="server" DataIndex="ID" Text="ID"></ext:Column>
<ext:Column ID="Column1" runat="server" DataIndex="Name" Text="NAME"></ext:Column>
<ext:Column ID="Column2" runat="server" DataIndex="Cate" Text="Cate">
<Editor>
<ext:SelectBox runat="server">
<Items>
<ext:ListItem Text="餐饮"/>
<ext:ListItem Text="娱乐"/>
<ext:ListItem Text="电子"/>
</Items>
<DirectEvents>
<KeyUp After="selectme"></KeyUp>
</DirectEvents>
</ext:SelectBox>
</Editor>
</ext:Column>
<ext:ComponentColumn Hidden="true" ID="cc_bz" runat="server" Align="Right" Text="币别" DataIndex="bizhong" Editor="True" Width="230">
<Component>
<ext:Container ID="Container3" runat="server" Layout="HBoxLayout">
<Items>
<ext:ComboBox ID="ComboBox1" runat="server" ItemID="Currency" InputWidth="60">
<Items>
<ext:ListItem Text="USD" Value="1" Mode="Raw" />
<ext:ListItem Text="EURO" Value="2" Mode="Raw" />
</Items>
</ext:ComboBox>
<ext:TextField runat="server" InputWidth="60"></ext:TextField>
<ext:TextField runat="server" FieldLabel="原币" LabelWidth="40" InputWidth="50"></ext:TextField>
</Items>
</ext:Container>
</Component>
</ext:ComponentColumn>
</Columns>
</ColumnModel>
<Plugins>
<ext:CellEditing runat="server"></ext:CellEditing>
</Plugins>
</ext:GridPanel>
</form>
</body>
</html>
please notice "selectme" event , why select a listitem from the SelectBox, why event not execute?how to find directevent events? have docs? I notice there is no SelectBox in extjs, where to find all his directevent?
Last edited by Daniil; Aug 08, 2013 at 6:06 AM.
Reason: [CLOSED]