View Full Version : [CLOSED] Add record into store of combo box doesnt work first time

Aug 25, 2015, 7:46 AM

I have a situation where I want to add a record into a store of a combo box. However, this never works the first time i.e. If I click the add button once it doesnt get added into the store but if I hit the add button a second time - it is then added.

Alternatively, if I open the dropdown (by clicking the drop down arrow) and then hit the add button for the first time it works.

After some advice here, thanks!

<ext:ResourceManager runat="server" ></ext:ResourceManager>
<ext:Button Text="Holder" runat="server">
<ext:Menu runat="server">
<ext:ComboBox runat="server" ID="dd" DisplayField="WishlistName" ValueField="WishlistName">
<ext:Store runat="server" ID="storeWishlists">
<ext:Model runat="server" Name="Wishlist" IDProperty="WishlistName">
<ext:ModelField Name="WishlistName" />
<ext:Button ID="Button1" Text="Add" runat="server">
<Click Fn="Wishlist1.addRecord" Scope="Wishlist1"></Click>

<script type="text/javascript">
var Wishlist1 = {
addRecord: function() {
this.store.add({ WishlistName: 'Another' });
Ext.onReady(function() {
Wishlist1.store = <%= storeWishlists.ClientID %>;

Aug 25, 2015, 9:03 AM
Hi @glenh,

Please try to set QueryMode="Local" for ComboBox.

Aug 25, 2015, 8:02 PM
Thanks Daniil

I knew I could count on you!

Aug 26, 2015, 6:13 AM
Thank you for that!:) And you are always welcome on the forums!