Apr 28, 2011, 2:57 PM
[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
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]