Jan 13, 2012, 10:34 AM
[CLOSED] ComboBox inside DropDownField causes it to collapse on item selection
Hi guys,
I have a problem with a combobox inside a DropDownField - dropdown field collapses when I select any combobox item. I'd like my dropdown to stay open...
In the following example I use a combo inside a CompositeControl inside DropDownField configured as GridPanel cell editor:
I have a problem with a combobox inside a DropDownField - dropdown field collapses when I select any combobox item. I'd like my dropdown to stay open...
In the following example I use a combo inside a CompositeControl inside DropDownField configured as GridPanel cell editor:
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.GridPanel1.Store.Primary.DataSource = this.GetData();
this.GridPanel1.Store.Primary.DataBind();
}
}
private object[] GetData()
{
return new object[]
{
new object[] { "3m Co", 71.72, 0.02, 0.03, "9/1 12:00am" },
new object[] { "Alcoa Inc", 29.01, 0.42, 1.47, "9/1 12:00am" },
new object[] { "Altria Group Inc", 83.81, 0.28, 0.34, "9/1 12:00am" },
new object[] { "American Express Company", 52.55, 0.01, 0.02, "9/1 12:00am" },
new object[] { "American International Group, Inc.", 64.13, 0.31, 0.49, "9/1 12:00am" },
};
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" RemoveViewState="true" IDMode="Explicit" />
<ext:GridPanel
ID="GridPanel1"
runat="server"
Title="Editable GridPanel"
StripeRows="true"
TrackMouseOver="true"
Width="700"
Height="350"
AutoExpandColumn="Name">
<Store>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="name" />
<ext:RecordField Name="price" Type="Float" />
<ext:RecordField Name="change" Type="Float" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ColumnID="Name" Header="Name" DataIndex="name">
<Editor>
<ext:TextField ID="TextField1" runat="server" />
</Editor>
</ext:Column>
<ext:Column Header="Price" DataIndex="price">
<Renderer Format="UsMoney" />
<Editor>
<ext:TextField ID="TextField2" runat="server" />
</Editor>
</ext:Column>
<ext:Column Header="Composite" Width="150" MenuDisabled="true">
<Editor>
<ext:DropDownField ID="DropDownField1" runat="server" Width="150" Height="100" ValidateOnBlur="false" Mode="ValueText" Text="" MinWidth="150">
<Component>
<ext:Panel ID="Panel1" runat="server">
<Items>
<ext:CompositeField ID="CompositeField2" runat="server" Width="150">
<Items>
<ext:Radio ID="Radio5" runat="server" BoxLabel="Option 1" />
<ext:ComboBox ID="ComboBox1" runat="server" Width="60" Mode="Local">
<Items>
<ext:ListItem Text="Last" Value="2" />
<ext:ListItem Text="Current" Value="4" />
</Items>
</ext:ComboBox>
</Items>
</ext:CompositeField>
</Items>
</ext:Panel>
</Component>
</ext:DropDownField>
</Editor>
<EditorOptions AllowBlur="false" AutoSize="Fit"/>
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" >
<Listeners>
<RowSelect Handler="this.grid.stopEditing();" />
</Listeners>
</ext:RowSelectionModel>
</SelectionModel>
</ext:GridPanel>
</body>
</html>
Last edited by Daniil; Jan 17, 2012 at 8:14 PM.
Reason: [CLOSED]