Jun 17, 2012, 4:08 PM
[CLOSED] [2.0] ComboBox store
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:
Cheers,
Timothy
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 1Cheers,
Timothy
Last edited by Daniil; Jun 19, 2012 at 12:46 AM.
Reason: [CLOSED]