Jun 20, 2013, 5:45 PM
Ext.Net: RowExpander: Unable to display nested GridPanel in Codebehind (VB.NET)
Hi everyone! Thank you in advance for your rsponses.
I'm developing an ASP.NET website and I'm using a GridPanel with a RowExpander section. :
Every example I run into is written in C#.
I'm developing an ASP.NET website and I'm using a GridPanel with a RowExpander section. :
<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>
In the codebehind, the function called "GetData", has to create dinamically the nested GridPanel looks like that:<Ext.Net.DirectMethod()>
Public Function GetGrid(ByVal parameters As Dictionary(Of String, String)) As Object
Dim data As New List(Of Object)
For i = 1 To 10
data.Add(New With {.ID = "P" & i, .Name = "Product " & i})
Next
Dim config As New Ext.Net.GridPanel.Config
config.Height = 50
config.EnableColumnHide = False
config.StoreID = "Store2"
Dim store As New Ext.Net.Store
Dim model As New Ext.Net.Model
store.ID = "Store2"
store.DataSource = data
store.ModelName = "Model2"
model.ID = "Model2"
model.IDProperty = "ID"
model.Fields.Add("ID")
model.Fields.Add("Name")
store.Model.Add(model)
config.Store.Add(store)
config.StoreID = "Store2"
Dim column As New Ext.Net.Column
column.ID = "ColumnModel2"
column.Text = "Products's Name"
column.DataIndex = "Name"
config.ColumnModel.Columns.Add(column)
config.ColumnModel.Add(column)
Dim grid As New Ext.Net.GridPanel(config)
Return Ext.Net.ComponentLoader.ToConfig(grid)
End Function
When I click the "+" in the GridPanel, it shows a empty grid, even without columns. In fact, the code generated by Ext.Net.ComponentLoader.ToConfig(grid) is:[{"height":50,"xtype":"grid","columns":{},"enableColumnHide":false,"store":"Store2"}]
So something I am doing wrong in the GetGrid function. What am I missing?Every example I run into is written in C#.