May 17, 2014, 2:27 PM
[CLOSED] how to pass DropDownField's text to his component(gridpanel)'s store as a parameter ?
i want to achieve a feature such as google suggest, when i type something in the dropdownfield, will search the data about sth. into the gridpanel,
for example , i type "a" , the data about "a" will automatic show in gridpanel .
how to pass s DropDownField's text to his component(gridpanel)'s store as a parameter , so i can search data about the user's type.
below is my test case.
for example , i type "a" , the data about "a" will automatic show in gridpanel .
how to pass s DropDownField's text to his component(gridpanel)'s store as a parameter , so i can search data about the user's type.
below is my test case.
<%@ Page Language="C#" %>
<!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 Page_Load(object sender, EventArgs e)
{
}
protected void Loadinfo(object sender, StoreReadDataEventArgs e)
{
var start = e.Start;
var limit = e.Limit;
int num = 100;
var infos = new object[]
{
new {title="aa",addtime="2014-04-05"},
new {title="aa",addtime="2014-04-05"},
new {title="aa",addtime="2014-04-05"},
new {title="aa",addtime="2014-04-05"},
new {title="aa",addtime="2014-04-05"},
new {title="aa",addtime="2014-04-05"},
new {title="aa",addtime="2014-04-05"},
new {title="aa",addtime="2014-04-05"},
new {title="bb",addtime="2014-04-05"},
new {title="bb",addtime="2014-04-05"},
new {title="bb",addtime="2014-04-05"},
new {title="bb",addtime="2014-04-05"},
new {title="bb",addtime="2014-04-05"},
new {title="bb",addtime="2014-04-05"},
new {title="bb",addtime="2014-04-05"},
new {title="bb",addtime="2014-04-05"},
new {title="bb",addtime="2014-04-05"}
};
e.Total = num;
s_info.DataSource = infos;
s_info.DataBind();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager runat="server" SourceFormatting="True" DisableViewState="False"></ext:ResourceManager>
<ext:DropDownField ID="ddf" runat="server" TriggerIcon="Search" Width="463">
<Component>
<ext:GridPanel runat="server" Title="分类信息">
<Store>
<ext:Store runat="server" ID="s_info" OnReadData="Loadinfo">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="title"></ext:ModelField>
<ext:ModelField Name="addtime"></ext:ModelField>
</Fields>
</ext:Model>
</Model>
<Proxy>
<ext:PageProxy></ext:PageProxy>
</Proxy>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column runat="server" DataIndex="title" Text="标题" Flex="1"></ext:Column>
<ext:DateColumn runat="server" DataIndex="addtime" Format="yyyy--MM-dd" Text="日期"></ext:DateColumn>
</Columns>
</ColumnModel>
<BottomBar>
<ext:Toolbar runat="server">
<Items>
<ext:PagingToolbar runat="server" StoreID="s_info"></ext:PagingToolbar>
</Items>
</ext:Toolbar>
</BottomBar>
</ext:GridPanel>
</Component>
</ext:DropDownField>
</form>
</body>
</html>
Last edited by Daniil; May 23, 2014 at 7:00 AM.
Reason: [CLOSED]