Jun 30, 2014, 3:17 PM
[CLOSED] Dynamically add a code to get a row and use the required parameters
Hi Team !!
I have the following problem, i have implemented the exercise "Row Expander Plugin with GridPanel" but I want to dynamically add a code to get a row and use the required parameters, but I can not find the code for that.
Any Help is appreciated.
Regards.
I have the following problem, i have implemented the exercise "Row Expander Plugin with GridPanel" but I want to dynamically add a code to get a row and use the required parameters, but I can not find the code for that.
<%@ 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)
{
//We do not need to DataBind on an DirectEvent
return;
}
List<object> data = new List<object>();
for (int i = 1; i <= 10; i++)
{
data.Add(new { ID = "S" + i, Name = "Supplier " + i});
}
this.Store1.DataSource = data;
this.Store1.DataBind();
}
[DirectMethod]
public static string GetGrid(Dictionary<string, string> parameters)
{
// string id = parameters["id"];
List<object> data = new List<object>();
for (int i = 1; i <= 5; i++)
{
data.Add(new { ID = "P" + i, Name = "Product " + i });
}
GridPanel grid = new GridPanel
{
Height = 200,
EnableColumnHide = false,
Store =
{
new Store
{
Model = {
new Model {
IDProperty = "ID",
Fields =
{
new ModelField("ID"),
new ModelField("Name")
}
}
},
DataSource = data
}
},
ColumnModel =
{
Columns =
{
new Column { Text = "Products's Name", DataIndex = "Name" }
}
},
BottomBar =
{
new PagingToolbar
{
DisplayInfo = true
, DisplayMsg = "{0} - {1} de {2}"
, EmptyMsg = "No hay registros a desplegar"
}
},
SelectionModel =
{
new RowSelectionModel
{
Mode = Ext.Net.SelectionMode.Single
, DirectEvents =
{
Select =
{
// ???????????????????????????
}
}
}
}
};
return ComponentLoader.ToConfig(grid);
}
</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>RowExpander with GridPanel - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<h1>Row Expander Plugin with GridPanel</h1>
<p>The caching is presented, GridPanel renders once only (until view refresh)</p>
<ext:GridPanel ID="GridPanel1"
runat="server"
Title="Expander Rows with GridPanel"
Collapsible="true"
AnimCollapse="true"
Icon="Table"
Width="600"
Height="450"
DisableSelection="true">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model ID="Model1" runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="ID" />
<ext:ModelField Name="Name" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="Supplier" DataIndex="Name" Flex="1" />
</Columns>
</ColumnModel>
<Plugins>
<ext:RowExpander ID="RowExpander1" runat="server">
<Loader ID="Loader1" runat="server" DirectMethod="#{DirectMethods}.GetGrid" Mode="Component">
<LoadMask ShowMask="true" />
<Params>
<ext:Parameter Name="id" Value="this.record.getId()" Mode="Raw" />
</Params>
</Loader>
</ext:RowExpander>
</Plugins>
</ext:GridPanel>
</form>
</body>
</html>
Any Help is appreciated.
Regards.
Last edited by Daniil; Jul 01, 2014 at 2:23 PM.
Reason: [CLOSED]