Apr 29, 2009, 7:36 PM
Ext.ux.plugins.GroupHeaderGrid with dinamics columns
Hi, I´m using Ext.ux.plugins.GroupHeaderGrid to make another header on a gridpanel.
All is ok if i configure the columns in this ways:
1) this.config[A] is undefined
2)this.mainBody is undefined
and there is no header or data in gridpanel.
I hope i explain myself, english is not my naturally language.
Sorry :(
Thanks for the help!!
Ariel
All is ok if i configure the columns in this ways:
<ext:GridPanel ID="gvFichadasDiarias" runat="server" StoreID="storeFichadasDiarias"
StripeRows="true" TrackMouseOver="true" Height="280px">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:RowNumbererColumn ColumnID="nros" />
<ext:Column ColumnID="Company" Header="Nombre" Width="160" Sortable="true" DataIndex="ApellidoNombre" />
<ext:Column Header="Legajo" Width="160" Sortable="true" DataIndex="Legajo" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
</SelectionModel>
<BottomBar>
<ext:PagingToolBar ID="PagingToolBar1" runat="server" PageSize="50" StoreID="storeFichadasDiarias"
DisplayMsg="{0} - {1} of {2}" />
</BottomBar>
</ext:GridPanel>
and in CodeBehindDim plug As New GenericPlugin
plug.ID = "GenericPlugin1"
plug.InstanceOf = "Ext.ux.plugins.GroupHeaderGrid"
gvFichadasDiarias.Plugins.Add(plug)
Dim cfItem As New ConfigItem
cfItem.Name = "rows"
cfItem.Value = "[[{header: 'Company-Price', colspan: 1, align: 'center'},{header: 'Company', colspan: 2, align: 'center'}]]"
cfItem.Mode = ParameterMode.Raw
plug.CustomConfig.Add(cfItem)
But the problem is that I need make columns dinamically so if i make this way<ext:GridPanel ID="gvFichadasDiarias" runat="server" StoreID="storeFichadasDiarias"
StripeRows="true" TrackMouseOver="true" Height="280px">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
</SelectionModel>
<BottomBar>
<ext:PagingToolBar ID="PagingToolBar1" runat="server" PageSize="50" StoreID="storeFichadasDiarias"
DisplayMsg="{0} - {1} of {2}" />
</BottomBar>
</ext:GridPanel>
and in CodeBehind
Dim data As Coolite.Ext.Web.Column
Dim rowNUm As New Coolite.Ext.Web.RowNumbererColumn
gvFichadasDiarias.ColumnModel.Columns.Add(rowNUm)
data = New Coolite.Ext.Web.Column
data.DataIndex = "LegajoInteger"
data.Header = Clasicos.Tr("Legajo")
data.Sortable = True
data.Width = "100"
'data.DataType = ExtExtenders.DataType.Numeric
gvFichadasDiarias.AddColumn(data)
data = New Coolite.Ext.Web.Column
data.DataIndex = "TarjetaInteger"
data.Header = Clasicos.Tr("Tarjeta")
data.Sortable = True
data.Width = "100"
'data.DataType = ExtExtenders.DataType.Numeric
gvFichadasDiarias.AddColumn(data)
storeFichadasDiarias.Reader(0).Fields.Add(New Coolite.Ext.Web.RecordField("Legajo"))
storeFichadasDiarias.Reader(0).Fields.Add(New Coolite.Ext.Web.RecordField("Tarjeta"))
Dim plug As New GenericPlugin
plug.ID = "GenericPlugin1"
plug.InstanceOf = "Ext.ux.plugins.GroupHeaderGrid"
gvFichadasDiarias.Plugins.Add(plug)
Dim cfItem As New ConfigItem
cfItem.Name = "rows"
cfItem.Value = "[[{header: 'Company-Price', colspan: 1, align: 'center'},{header: 'Company', colspan: 2, align: 'center'}]]"
cfItem.Mode = ParameterMode.Raw
plug.CustomConfig.Add(cfItem)
I have two errors in FireBug1) this.config[A] is undefined
2)this.mainBody is undefined
and there is no header or data in gridpanel.
I hope i explain myself, english is not my naturally language.
Sorry :(
Thanks for the help!!
Ariel