Jan 30, 2009, 5:06 AM
Complex Serialization and Templates
Hi,
I am using templates in a combo with complex type from the store.
I was wondering whether it is possible to use them in the template as shown below.
Shall I use a Mapping ? If yes, how ?
The store :
The combo :
Best Regards.
Bruno.
I am using templates in a combo with complex type from the store.
I was wondering whether it is possible to use them in the template as shown below.
Shall I use a Mapping ? If yes, how ?
The store :
<ext:Store runat="server" ID="stoUsers" IgnoreExtraFields="true" AutoLoad="false" SerializationMode="Complex">
<Proxy>
<ext:HttpProxy Method="GET" />
</Proxy>
<Reader>
<ext:JsonReader Root="Users" TotalProperty="Total" ReaderID="ID">
<Fields>
<ext:RecordField Name="ID" Type="Int" />
<ext:RecordField Name="Name" Type="String" />
<ext:RecordField Name="Address.City" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
The combo :
<ext:ComboBox runat="server" ID="ddlUsers"
HideTrigger="true"
AllowBlank="false"
ForceSelection="true"
BlankText="Required Field"
Width="450"
StoreID="stoUsers"
DisplayField="Name"
ValueField="ID"
TypeAhead="false"
PageSize="10"
ItemSelector="div.search-item"
MinChars="1">
<Template ID="tplUsers" runat="server">
<tpl for=".">
<div class="search-item">
<h3>{Name}</h3>
{Address.City}
</tpl>
</Template>
</ext:ComboBox>
Best Regards.
Bruno.