Apr 03, 2015, 10:12 AM
[CLOSED] ComboBox after load set initial value to blank
I have a combo box defined as:
How can I accomplish that please?
Thank you
X.ComboBoxFor(m => m.CARR_TAX_CODE).FieldLabel("Tax Code").LabelWidth(80).ValueField("TaxCodeID").AllowBlank(true)
.TypeAhead(true)
.ForceSelection(true)
.ListConfig(Html.X().BoundList()
.ItemTpl(Html.X().XTemplate()
.Html(@<text>
<div class="list-item">
<h3>{Name} - Rate: {RATE}%</h3>
{DESCRIPTION}
</div>
</text>)
)
)
.DisplayTpl(Html.X().XTemplate()
.Html(@<text>
<tpl for=".">
{Name} - Rate: {RATE}
</tpl>
</text>)
)
.Store(X.Store()
.ID("TaxCodeComboStore")
.AutoLoad(true)
.Model(
X.Model()
.Name("TaxCodeComboForCombo")
.IDProperty("TaxCodeID")
.Fields(
X.ModelField()
.Name("Name")
.Type(ModelFieldType.String),
X.ModelField()
.Name("DESCRIPTION")
.Type(ModelFieldType.String),
X.ModelField()
.Name("RATE")
.Type(ModelFieldType.Float)
)
)
.Proxy(Html.X().AjaxProxy()
.Url(Url.Action("GetList", "List", new { area = "TaxCode" }))
.Reader(Html.X().JsonReader().Root("data"))
))
After it load the values from the store, the first item in the list is displayed and selected in the field. I would like it to be blank after loading.How can I accomplish that please?
Thank you
Last edited by Daniil; Apr 04, 2015 at 2:50 PM.
Reason: [CLOSED]