Aug 17, 2010, 10:08 AM
[CLOSED] Change value Store field within combobox and template
Hi,
I'm using a simple multicolumn template in a combobox. Populating that combobox from store (databinding store and sql source in codebehind)
Is it possible to format one of those colums ? I can't change the datasource but need to format a yyyymmdd integer field into a 'normal' date: dd-MM-yyyy
In this code I need to format the {huidigekmStandPer} value.
I'm using a simple multicolumn template in a combobox. Populating that combobox from store (databinding store and sql source in codebehind)
Is it possible to format one of those colums ? I can't change the datasource but need to format a yyyymmdd integer field into a 'normal' date: dd-MM-yyyy
In this code I need to format the {huidigekmStandPer} value.
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:JsonReader IDProperty="Kenteken">
<Fields>
<ext:RecordField Name="kenteken" />
<ext:RecordField Name="huidigekmStand" />
<ext:RecordField Name="huidigekmStandPer" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:ComboBox
ID="cbKenteken"
runat="server"
EmptyText="Selecteer kenteken"
TypeAhead="true"
FieldLabel="Kenteken"
ForceSelection="true"
StoreID="Store1"
DisplayField="kenteken"
ValueField="kenteken"
MinChars="1"
PageSize="2"
ItemSelector="tr.list-item"
AnchorHorizontal="100%"
>
<Template ID="Template1" runat="server">
<Html>
<tpl for=".">
<tpl if="[xindex] == 1">
<table class="cbStates-list" width="100%">
<tr>
<th>Kenteken</th>
<th>Stand</th>
<th>Datum</th>
</tr>
</tpl>
<tr class="list-item">
<td style="">{kenteken}</td>
<td style="padding:10px 0px;text-align:right;">{huidigekmStand}</td>
<td style="padding:10px 0px;">{huidigekmStandPer}</td>
</tr>
<tpl if="[xcount-xindex]==0">
</table>
</tpl>
</tpl>
</Html>
</Template>
<Triggers>
<ext:FieldTrigger Icon="Clear" HideTrigger="true" />
</Triggers>
<Listeners>
<BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
<TriggerClick Handler="if (index == 0) { el.focus().clearValue(); trigger.hide();}" />
<Select Handler="el.triggers[0].show();" />
</Listeners>
</ext:ComboBox>
Martin
Last edited by Daniil; Aug 17, 2010 at 3:34 PM.
Reason: [CLOSED]