PDA

View Full Version : [CLOSED] Disabled specific item combobox



xeo4.it
Jan 28, 2014, 4:20 PM
Hi,
the method to disable a specific item of combo box doen't work anymore,
see my example.
Thank you

Jimmy



<%@ Page Language="C#" %>


<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>


<!DOCTYPE html>


<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Store store = this.ComboBox1.GetStore();

store.DataSource = new object[]
{
new object[] { ResourceManager.GetIconClassName(Icon.FlagFr), "France", false},
new object[] { ResourceManager.GetIconClassName(Icon.FlagCa), "Canada", true},
new object[] { ResourceManager.GetIconClassName(Icon.FlagDe), "Germany", false},
new object[] { ResourceManager.GetIconClassName(Icon.FlagUs), "United States", false},
new object[] { ResourceManager.GetIconClassName(Icon.FlagIt), "Italy", true}
};

store.DataBind();


this.ResourceManager1.RegisterIcon(Icon.FlagFr);
this.ResourceManager1.RegisterIcon(Icon.FlagCa);
this.ResourceManager1.RegisterIcon(Icon.FlagDe);
this.ResourceManager1.RegisterIcon(Icon.FlagUs);
this.ResourceManager1.RegisterIcon(Icon.FlagIt);
}
</script>


<html>
<head id="Head1" runat="server">
<title>IconCombo - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
<style>
.icon-combo-item {
background-repeat : no-repeat !important;
background-position : 3px 50% !important;
padding-left : 24px !important;
}
</style>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<h1>Render an Icon in ComboBox data items</h1>


<ext:ComboBox
ID="ComboBox1"
runat="server"
Width="250"
Editable="false"
DisplayField="name"
ValueField="name"
QueryMode="Local"
TriggerAction="All"
EmptyText="Select a country...">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="iconCls" />
<ext:ModelField Name="name" />
<ext:ModelField Name="disabled" Type="Boolean" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ListConfig>
<ItemTpl ID="ItemTpl1" runat="server">
<Html>
<div {[getAttributes(values.disabled)]} class="icon-combo-item {iconCls}" >
{name}
</div>
</Html>
</ItemTpl>
</ListConfig>

</ext:ComboBox>
</form>
</body>
</html>

Daniil
Jan 29, 2014, 6:00 AM
Hi Jimmy,

This appears to be working.
http://forums.ext.net/showthread.php?23388&p=102128&viewfull=1#post102128

xeo4.it
Jan 29, 2014, 9:48 AM
Hi Daniil,
it works fine,
thank you very much.

Jimmy