[CLOSED] Using custom template in a ComboBox

  1. #1

    [CLOSED] Using custom template in a ComboBox

    Hi,

    As per a previous support issue, I'm using a template to render the content of my ComboBox. It all renders OK, but I can't select the items from the dropdown - they don't appear as selectable... is there something missing from my template?

    Thanks

    <ext:ComboBox ID="ResultsSetCombo" runat="server" FieldLabel="Mapping Result Set"
                                    Editable="false" DisplayField="CreationDate" ValueField="FrontEndMappingSetId" TypeAhead="false"
                                    Mode="Local" DataIndex="FrontEndMappingSetId" Width="500" SelectedIndex="0">
                                    <Store>
                                        <ext:Store ID="FrontEndMappingResultsStore" runat="server" AutoLoad="true">
                                        <Reader>
                                            <ext:JsonReader IDProperty="FrontEndMappingSetId">
                                                <Fields>
                                                    <ext:RecordField Name="FrontEndMappingSetId" />
                                                    <ext:RecordField Name="CreationDate" Type="Date"/>
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>            
                                        </ext:Store>
                                    </Store>
                                    <Template runat="server">
                                        <Html>
                                            <tpl for=".">
                                                <div>{CreationDate:date("d-M-Y h:i")}</div>
                                            </tpl>
                                        </Html>
                                    </Template>
                                    <Listeners>
                                        <AfterRender Fn="onAfterRender" />
                                        <Select Fn="onSelect" />
                                        <Blur Fn="onBlur" />
                                    </Listeners>
                                </ext:ComboBox>
    
        var onAfterRender = function () {
                this.setRawValue(Ext.util.Format.date(this.getRawValue(), "d-M-Y h:i"));
            }
    
            var onSelect = function (combo, record, index) {
                this.setRawValue(Ext.util.Format.date(record.get("CreationDate"), "d-M-Y h:i"));
                MappingResultsStore.reload();
    
            }
    
            var onBlur = function () {
                this.setRawValue(Ext.util.Format.date(this.getRawValue(), "d-M-Y h:i"));
            }
    Last edited by Daniil; May 02, 2011 at 10:37 AM. Reason: [CLOSED]
  2. #2
    Hi,

    You have to define ItemSelector property
    Please see
    http://examples1.ext.net/#/Form/Comb...rop_Down_List/
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. Custom Template Column
    By QualityCode in forum 1.x Help
    Replies: 2
    Last Post: Oct 29, 2011, 11:18 PM
  2. [CLOSED] [1.0] ComboBox Template
    By state in forum 1.x Premium Help
    Replies: 2
    Last Post: Mar 25, 2010, 5:36 PM
  3. [CLOSED] Custom Template From CodeBehind
    By Immobilmente in forum 1.x Premium Help
    Replies: 2
    Last Post: Feb 10, 2009, 9:35 AM
  4. Custom Grid Header Template
    By mathec in forum 1.x Help
    Replies: 2
    Last Post: Jan 30, 2009, 7:20 PM
  5. [CLOSED] Grouping View Custom Template
    By peterdiplaros in forum 1.x Premium Help
    Replies: 12
    Last Post: Dec 08, 2008, 1:22 PM

Posting Permissions