May 16, 2013, 9:35 PM
[OPEN] [#242] ComboBox List Alignment
Hi,
How can I do ComboBox list alignment ?
Thanks,
// ------------------------------------------------------------------
How can I do ComboBox list alignment ?
Thanks,
// ------------------------------------------------------------------
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
public void Page_Load(object sender, EventArgs e)
{
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.Load(HttpContext.Current.Server.MapPath("Plants.xml"));
System.Collections.Generic.List<object> data = new System.Collections.Generic.List<object>();
IFormatProvider culture = new System.Globalization.CultureInfo("en-US", true);
foreach (System.Xml.XmlNode plantNode in xmlDoc.SelectNodes("catalog/plant"))
{
data.Add(new
{
Common = plantNode.SelectSingleNode("common").InnerText,
Botanical = plantNode.SelectSingleNode("botanical").InnerText,
Zone = plantNode.SelectSingleNode("zone").InnerText,
Light = plantNode.SelectSingleNode("light").InnerText,
Price = decimal.Parse(plantNode.SelectSingleNode("price").InnerText, culture),
Availability = DateTime.Parse(plantNode.SelectSingleNode("availability").InnerText, culture),
Indoor = bool.Parse(plantNode.SelectSingleNode("indoor").InnerText)
});
}
Store1.DataSource = data;
Store1.DataBind();
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.search-item {
font : normal 11px tahoma, arial, helvetica, sans-serif;
/*padding : 3px 20px 3px 20px;*/
border : 1px solid #fff;
border-bottom : 1px solid #eeeeee;
white-space : normal;
color : #555;
}
.search-item h3 {
display : block;
font : inherit;
font-weight : bold;
color : #222;
margin :0px;
}
.search-item h3 span {
float : right;
font-weight : normal;
/*margin : 0 0 5px 5px;
width : 100px;*/
display : block;
clear : none;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager runat="server" />
<ext:FormPanel runat="server" AnchorHorizontal="100%">
<Items>
<ext:FieldContainer runat="server" Layout="HBoxLayout">
<Items>
<ext:DisplayField runat="server" FieldLabel="Name" />
<ext:TextField runat="server" />
<ext:DisplayField runat="server" FieldLabel="Last Name" />
<ext:TextField runat="server" />
<ext:DisplayField runat="server" FieldLabel="Plant" />
<ext:ComboBox ID="ComboBox2"
runat="server"
DisplayField="Common"
ValueField="Common"
PageSize="10"
HideBaseTrigger="true"
MinChars="0"
TriggerAction="Query"
Flex="1">
<ListConfig LoadingText="Searching..." ID="lstPessoa" runat="server" >
<ItemTpl ID="ItemTpl1" runat="server">
<Html>
<div class="search-item">
<h3><span>${Price}</span>{Common}</h3>
{Botanical}
</div>
</Html>
</ItemTpl>
</ListConfig>
<Store>
<ext:Store ID="Store1" runat="server" AutoLoad="false">
<Proxy>
<ext:PageProxy />
</Proxy>
<Model>
<ext:Model ID="Model3" runat="server">
<Fields>
<ext:ModelField Name="Common" />
<ext:ModelField Name="Botanical" />
<ext:ModelField Name="Light" />
<ext:ModelField Name="Price" Type="Float" />
<ext:ModelField Name="Indoor" Type="Boolean" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:ComboBox>
</Items>
</ext:FieldContainer>
</Items>
</ext:FormPanel>
</form>
</body>
</html>
Last edited by Daniil; May 17, 2013 at 5:07 AM.
Reason: [OPEN] [#242]