[CLOSED] Change value Store field within combobox and template

  1. #1

    [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.

    <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]
  2. #2
    Mark as Solved...

    Discovered the <Convert> tag within the RecordField Object. I convert the integer to date using a javascript function.

    martin

Similar Threads

  1. [CLOSED] change combobox store dynasmically
    By sisa in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Nov 22, 2011, 1:17 PM
  2. [CLOSED] DataView Template unable to read the store Record Field
    By farisqadadeh in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 20, 2010, 3:23 PM
  3. Replies: 1
    Last Post: Oct 06, 2009, 10:58 AM
  4. Replies: 0
    Last Post: Jun 26, 2009, 11:32 AM
  5. Replies: 0
    Last Post: May 07, 2009, 3:00 AM

Posting Permissions