Jun 27, 2014, 12:18 PM
[CLOSED] [#515] Problem With Store+ComboBox+ComponentColumn in Ext.Net 2.5 (working in Ext.Net 2.4)
Hi all,
in the attached aspx Page I need the Store/ComboBox/ComponentColumn working correctly with Ext.Net Libraries 2.5.
To test, click Manage Ran -> Automatic Adj Plan.
As you can test, the store/combobox is not re-loaded (is undefined) if you close and re-open the window that contains it.
The example does not works with 2.5 version referenced It works with 2.4 version of the Ext.Net, Ext.Net.Utilities, Newtonsoft.Json dll
Thanks in advance, bye
in the attached aspx Page I need the Store/ComboBox/ComponentColumn working correctly with Ext.Net Libraries 2.5.
To test, click Manage Ran -> Automatic Adj Plan.
As you can test, the store/combobox is not re-loaded (is undefined) if you close and re-open the window that contains it.
The example does not works with 2.5 version referenced It works with 2.4 version of the Ext.Net, Ext.Net.Utilities, Newtonsoft.Json dll
Thanks in advance, bye
<%@ Page Title="" Language="C#" AutoEventWireup="true" %>
<%@Import Namespace="System.Data" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
/// <summary>
/// AutomaticAdjPlan OnClick Event Handler
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAutomaticAdjPlan_OnClick(object sender, DirectEventArgs e)
{
try
{
//--------------------------------------------------------------
ShowWindowsAutomaticAdj();
//--------------------------------------------------------------
}
catch (Exception exc)
{
// XExt.XUtil.ShowNotification("TITLE", String.Format("{0}: {1}", "NODEB", exc.Message), hideDelay: 5000);
}
}
/// <summary>
/// Show Automatic Plan
/// </summary>
public void ShowWindowsAutomaticAdj()
{
this.stoTargetCell_StsName2G.Reload();
LoadAdjConfigurationGrid();
wndAdjAutomaticCreate.Show();
wndAdjAutomaticCreate.Center();
}
/// <summary>
/// LoadAdjConfigurationGrid
/// </summary>
private void LoadAdjConfigurationGrid()
{
var dataLayout = new DataTable();
dataLayout.Columns.Add(new DataColumn("Source_Cell", typeof(string)));
dataLayout.Columns.Add(new DataColumn("Source_Azimuth", typeof(string)));
dataLayout.Columns.Add(new DataColumn("Adj2G_TargetCell", typeof(string)));
for (int i=1; i<=1; i++)
{
var rowToAdd = dataLayout.NewRow();
rowToAdd["Adj2G_TargetCell"] = "Cella 2G " + i.ToString();
rowToAdd["Source_Azimuth"] = "30";
rowToAdd["Source_Cell"] = "$-MM@0009988";
dataLayout.Rows.Add(rowToAdd);
}
stoAdj_TargetCell.DataSource = dataLayout;
stoAdj_TargetCell.DataBind();
}
/// <summary>
/// Caricamento store per combobox 2G
/// </summary>
protected void stoCloningCell_Load2G(object sender, StoreReadDataEventArgs e)
{
var dataLayout = new DataTable();
dataLayout.Columns.Add(new DataColumn("Text", typeof(string)));
dataLayout.Columns.Add(new DataColumn("Value", typeof(string)));
for (int i = 1; i <= 4; i++)
{
var rowToAdd = dataLayout.NewRow();
rowToAdd["Text"] = "xxxx 2G " + i.ToString();
rowToAdd["Value"] = "xxxx 2G " + i.ToString();
dataLayout.Rows.Add(rowToAdd);
}
this.stoTargetCell_StsName2G.DataSource = dataLayout;
this.stoTargetCell_StsName2G.DataBind();
}
</script>
<script type="text/javascript">
var st;
</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">
<title>Configuration Manager</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:ResourceManager ID="ResourceManager1" runat="server" AjaxTimeout="3600000"></ext:ResourceManager>
<ext:Viewport ID="vwpMaster" runat="server" Layout="FitLayout">
<Items>
<ext:Panel ID="pnlCenter" runat="server" Title="Center" Header="false" Layout="fit">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button ID="btnRanManagament" runat="server" Text="Manage Ran" Pressed="False" AllowDepress="False" Icon="TransmitRed">
<Menu>
<ext:Menu ID="mnuManageSector" runat="server">
<Items>
<ext:MenuItem ID="mnuAutomaticAdjPlan" runat="server" Text="Automatic Adj Plan" Icon="ShapeMoveBack">
<DirectEvents>
<Click OnEvent="btnAutomaticAdjPlan_OnClick">
<EventMask ShowMask="true" />
</Click>
</DirectEvents>
</ext:MenuItem>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Content>
<ext:Window ID="wndAdjAutomaticCreate" runat="server" Icon="Cmy" Width="800" Height="300" Title="Adj Plan Details"
AutoShow="false" Modal="true" Hidden="true" Maximizable="false" Layout="border" AutoScroll="false"
Maximized="false" Resizable="false" Closable="true" CloseAction="Hide">
<Items>
<ext:GridPanel ID="gplAdj_TargetCell" runat="server" Region="North" Border="false" SortableColumns="false" AutoScroll="true">
<Store>
<ext:Store ID="stoAdj_TargetCell" runat="server">
<Model>
<ext:Model ID="modAdj_TargetCell" runat="server">
<Fields>
<ext:ModelField Name="Source_Cell" Type="String" />
<ext:ModelField Name="Source_Azimuth" Type="String" />
<ext:ModelField Name="Adj2G_TargetCell" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<SelectionModel>
<ext:CheckboxSelectionModel ID="CheckboxSelectionAdj_TargetCell" Mode="Multi" runat="server" />
</SelectionModel>
<ColumnModel ID="ColumnModelAdj" runat="server">
<Columns>
<ext:Column ID="clnAdj_SourceCell" runat="server" DataIndex="Source_Cell" Text="Source Cell" />
<ext:Column ID="clnAdj_SourceAzimuth" runat="server" DataIndex="Source_Azimuth" Text="Source Azimuth" />
<ext:ComponentColumn ID="clnAdj2G_TargetCell" runat="server" Editor="true" DataIndex="Adj2G_TargetCell" Flex="1"
Text="2G Colocated Cell">
<Component>
<ext:ComboBox ID="cmbAdj2G_TargetCell"
runat="server"
DisplayField="Text"
ValueField="Value"
EmptyText="Select...">
</ext:ComboBox>
</Component>
<Listeners>
<BeforeBind Handler="
if (#{stoTargetCell_StsName2G})
{
e.config[0].store = #{stoTargetCell_StsName2G};
}
else
{
e.config[0].store = st;
// alert(#{stoTargetCell_StsName2G});
}
">
</BeforeBind>
</Listeners>
</ext:ComponentColumn>
</Columns>
</ColumnModel>
<Listeners>
<AfterLayout Handler="#{gplAdj_TargetCell}.getSelectionModel().selectAll();" />
</Listeners>
</ext:GridPanel>
</Items>
<Bin>
<ext:Store ID="stoTargetCell_StsName2G" runat="server" OnReadData="stoCloningCell_Load2G" AutoLoad="false">
<Model>
<ext:Model ID="Model2G" runat="server" IDProperty="Value" >
<Fields>
<ext:ModelField Name="Text" Type="String" />
<ext:ModelField Name="Value" Type="String" />
</Fields>
</ext:Model>
</Model>
<Listeners>
<Load Handler="st=this;"></Load>
</Listeners>
</ext:Store>
</Bin>
</ext:Window>
</Content>
</ext:Panel>
</Items>
</ext:Viewport>
</div>
</form>
</body>
</html>
Last edited by Daniil; Jul 08, 2014 at 5:26 AM.
Reason: [CLOSED]