PDA

View Full Version : [CLOSED] [2.0] ComboBox store



Timothy
Jun 17, 2012, 4:08 PM
Hello,

If you have a ComboBox like the following, that is empty on initialization, and then run a function to add an entry to the store, the ComboBox will not show the added entry until a second one is added:



b.Add(Html.X().ComboBox()
.ID("drpField1")
.AllowBlank(false)
.AnchorHorizontal("100%")
.DisplayField("Text")
.Editable(false)
.FieldLabel("Field 1")
.ForceSelection(true)
.SimpleSubmit(true)
.TypeAhead(false)
.ValueField("Value")
.Store(store =>
store.Add(Html.X().Store()
.Model(model =>
model.Add(Html.X().Model()
.Fields(fields =>
{
fields.Add(Html.X().ModelField()
.Name("Text")
);


fields.Add(Html.X().ModelField()
.Name("Value")
);
} )
)
)
)
)
);


Use the following on a button click listener:


var store = App.drpField1.getStore();
store.add( {
Text: '1',
Value: '1'
} );


Works after you click the button again -- it will show 2 entries, but it will never just show 1

Cheers,
Timothy

Daniil
Jun 17, 2012, 7:22 PM
Hi,

Thanks for the report. I have re-reported it to Sencha.
http://www.sencha.com/forum/showthread.php?222348-4.1.1-rc2-ComboBox-Store-doesn-t-add-record-at-the-first-time-further-ok.&p=835742#post835742

Timothy
Jun 17, 2012, 9:24 PM
Hi,

Thanks for the report. I have re-reported it to Sencha.
http://www.sencha.com/forum/showthread.php?222348-4.1.1-rc2-ComboBox-Store-doesn-t-add-record-at-the-first-time-further-ok.&p=835742#post835742

Thanks Daniil!

Daniil
Jun 18, 2012, 10:39 AM
There was the update.
http://www.sencha.com/forum/showthread.php?222348&p=835813&viewfull=1#post835813

Please just set up

QueryMode="local"
for the ComboBox.

Timothy
Jun 19, 2012, 12:15 AM
Confirmed, thanks!