Aug 26, 2016, 6:55 PM
[CLOSED] ComboBox TypeAhead in Each Field Separately
Dears,
Suppose I have the following ComboBox:
How to achieve the followings:
1. How to perform search in each field separately, means if I want to search in English only or in Arabic Only with mixing things with each other?
2. Do you suggest better than this solution? I mean another way to achieve this with another component?
Regards,
Ali Alaswad
Suppose I have the following ComboBox:
<ext:ComboBox Flex="1" TypeAhead="true" ForceSelection="true" QueryMode="Local" MinWidth="800" PaddingSpec="0 15 0 5" ID="ddlEditActivityCode" ClientIDMode="Static" ValueField="ID" DisplayField="CODEANDDESC" runat="server" >
<Store>
<ext:Store ClientIDMode="Static" ID="ddlEditActivityCodeStore" runat="server">
<Model>
<ext:Model ClientIDMode="Static" ID="ddlEditActivityCodeModel" runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="ID" Type="String" />
<ext:ModelField Name="ACTIVITY_NAME_ENGLISH" Type="String" />
<ext:ModelField Name="ACTIVITY_NAME_ARABIC" Type="String" />
<ext:ModelField Name="CODEANDDESC" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ListConfig Width="800" Height="300" ItemSelector=".x-boundlist-item">
<Tpl runat="server">
<Html>
<tpl for=".">
<tpl if="[xindex] == 1">
<table class="cbStates-list">
<tr>
<th>Activity Code</th>
<th>English Name</th>
<th>Arabic Name</th>
</tr>
</tpl>
<tr class="x-boundlist-item">
<td>{ID}</td>
<td>{ACTIVITY_NAME_ENGLISH}</td>
<td>{ACTIVITY_NAME_ARABIC}</td>
</tr>
<tpl if="[xcount-xindex]==0">
</table>
</tpl>
</tpl>
</html> </Tpl>
</ListConfig>
<Triggers>
<ext:FieldTrigger Icon="Clear" Hidden="true" />
</Triggers>
<Listeners>
<BeforeQuery Handler="var q = queryEvent.query;
queryEvent.query = new RegExp(q);
queryEvent.query.length = q.length;" />
<TriggerClick Handler="if (index == 0) {
this.focus().clearValue();
trigger.hide();
}" />
<Select Handler="this.getTrigger(0).show();" />
</Listeners>
</ext:ComboBox>
Now if I perform search with Code, the list get shortening, but when I try to search through English or Arabic the result comes wrong.How to achieve the followings:
1. How to perform search in each field separately, means if I want to search in English only or in Arabic Only with mixing things with each other?
2. Do you suggest better than this solution? I mean another way to achieve this with another component?
Regards,
Ali Alaswad
Last edited by fabricio.murta; Oct 07, 2016 at 7:48 AM.