Sep 17, 2009, 6:02 AM
ComboBox with search functionality - setting saved values
Hi!
I have combo based on sample https://examples1.ext.net/#/Form/Com...Custom_Search/.
I modified it to work as a address finder.
User can enter zip code or city name and can choose one of displayed cities.
It works well with user interaction.
There is a problem with data display - how to set properly data to this combo?
In code behind:
1) When I set
2) when I set
I know that problem is that when binding from database store has no data.
How to handle such a situation (remember that there are thousands of cities in database.... - I can't initially fill store.....)?
There is for example a listner where I can add one row to store when binding data to controls?
I have combo based on sample https://examples1.ext.net/#/Form/Com...Custom_Search/.
I modified it to work as a address finder.
User can enter zip code or city name and can choose one of displayed cities.
It works well with user interaction.
There is a problem with data display - how to set properly data to this combo?
<ext:ComboBox ID="ComboBoxKodPocztowy" runat="server" FieldLabel="Miejscowosc" TypeAhead="false"
LoadingText="Wyszukuje..." MinChars="1" AllowBlank="false" StoreID="StoreKodPocztowy"
PageSize="20" Editable="true" DisplayField="KodMiasto" ValueField="Id" ItemSelector="div.list-item"
TriggerAction="All" BlankText="Miejscowosc musi byc wypelniona" Selectonfocus="true"
ListWidth="500" ForceSelection="true">
<Template ID="Template1" runat="server">
<tpl for=".">
<div class="list-item">
{KodPocztowy}, &nbsp;{MiejscowoscNazwa} : {WojewodztwoNazwa}, {Powiat}, {Ulica}
</tpl>
</Template>
</ext:ComboBox>
In code behind:
1) When I set
ComboBoxKodPocztowy.SelectedItem.Value = valFromDb;
- id of item is presented in combo box2) when I set
ComboBoxKodPocztowy.SetRawValue("zip code and name of selected city");
value combo text disappears when focus leave ComboBox....I know that problem is that when binding from database store has no data.
How to handle such a situation (remember that there are thousands of cities in database.... - I can't initially fill store.....)?
There is for example a listner where I can add one row to store when binding data to controls?
Last edited by geoffrey.mcgill; Jan 11, 2011 at 10:30 PM.