Sep 27, 2014, 4:43 AM
[CLOSED] Combobox with all icon MVC
Hi,
How do I populate a combobox with all EXT.Net Icons from code behind,I am unable to find example or any forum post.please help.
I read http://forums.ext.net/showthread.php...-List-of-Icons and http://forums.ext.net/showthread.php...obox-with-Icon and try some thing bellow.but not working
How do I populate a combobox with all EXT.Net Icons from code behind,I am unable to find example or any forum post.please help.
I read http://forums.ext.net/showthread.php...-List-of-Icons and http://forums.ext.net/showthread.php...obox-with-Icon and try some thing bellow.but not working
Html.X().ComboBox()
.ID("ComboBoxAllIcons")
.Editable(false)
.QueryMode(DataLoadMode.Local)
.TriggerAction(TriggerAction.All)
.EmptyText("Select a country")
.DisplayField("name")
.ValueField("name")
.FieldLabel("Country")
.ForceSelection(true)
.Store(Html.X().Store()
.ID("strore1")
.Model(Html.X().Model()
// .IDProperty("Id")
.Fields(
Html.X().ModelField().Name("iconCls").Type(ModelFieldType.String),
Html.X().ModelField().Name("name").Type(ModelFieldType.String)
)
)
)
.ListConfig(Html.X().BoundList()
.ItemTpl(Html.X().XTemplate()
.Html(@<tpl for=".">
<div class="x-combo-list-item icon-combo-item {iconCls}">
{name}
</div>
</tpl>)
)
)
public ActionResult Index()
{
List<string> s= Enum.GetNames(typeof(Icon)).ToList<string>();
var st = X.GetCmp<Store>("strore1");
st.LoadData(s);
return View();
}
Last edited by Daniil; Feb 03, 2015 at 2:11 PM.
Reason: [CLOSED]