[CLOSED] [1.0] Can not reconfigure GridPanel with different number of RecordField vs Column

  1. #1

    [CLOSED] [1.0] Can not reconfigure GridPanel with different number of RecordField vs Column

    If I reconfigure my gridpanel with new fields and columns, it throws a javascript error if there are more columns than fields. In my case, the extra column is a RowNumberer.

    If I add a dummy field, I can get past the first error only to get a different error with RowNumberer not having a reference to the grid.


    
    
    <script runat="server">
        
        Private Sub store_RefreshData(ByVal sender As Object, ByVal e As Ext.Net.StoreRefreshDataEventArgs) Handles store.RefreshData
            Me.grid.ColumnModel.Columns.Clear()
            Me.grid.ColumnModel.Columns.Add(New Ext.Net.RowNumbererColumn With {.Locked = True})
            Me.grid.ColumnModel.Columns.Add(New Ext.Net.Column() With {.ColumnID = "Name", .Header = "Name"})
            
            Me.store.RemoveFields()
            'Me.store.AddField(New Ext.Net.RecordField("Dummy", RecordFieldType.String))
            Me.store.AddField(New Ext.Net.RecordField("Name", RecordFieldType.String))
            
            Me.grid.Reconfigure()
            
            Dim list As New Generic.List(Of Object)
            list.Add(New With {.Name = "Dog"})
            list.Add(New With {.Name = "Cat"})
            
            Me.store.DataSource = list
        End Sub
        
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager runat="server">
        </ext:ResourceManager>
        <ext:Store runat="server" ID="store" AutoLoad="true">
            <Proxy>
                <ext:PageProxy AutoDataBind="true">
                </ext:PageProxy>
            </Proxy>
            <Reader>
                <ext:JsonReader>
                    <Fields>
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:GridPanel runat="server" ID="grid" Title="grid" StoreID="store" Height="500">
            <ColumnModel>
                <Columns>
                    <ext:RowNumbererColumn Locked="true">
                    </ext:RowNumbererColumn>
                </Columns>
            </ColumnModel>
            <View>
                <ext:LockingGridView  runat="server">
                </ext:LockingGridView>
            </View>
        </ext:GridPanel>
        </form>
    </body>
    </html>
  2. #2

    RE: [CLOSED] [1.0] Can not reconfigure GridPanel with different number of RecordField vs Column

    Hi,

    Just you have to specify DataIndex for the Column (if data index is missed then mapping column/field will be performed by index)


    If you still have problems (even with DataIndex) then please update from SVN
  3. #3

    RE: [CLOSED] [1.0] Can not reconfigure GridPanel with different number of RecordField vs Column

    Thanks! I had the DataIndex set in my application but forgot about it in the test sample. I updated from SVN and the second error with RowNumberer is gone.

Similar Threads

  1. Format Number in GridPanel Template Column
    By pooja in forum 1.x Help
    Replies: 0
    Last Post: May 04, 2012, 9:43 AM
  2. [CLOSED] RecordField vs ModelField and Reconfigure vs Render
    By Sevilay Tanış in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 13, 2012, 3:20 PM
  3. Replies: 2
    Last Post: Nov 23, 2011, 1:02 AM
  4. Replies: 0
    Last Post: Aug 30, 2011, 2:48 PM
  5. [CLOSED] Refresh gridpanel row number column
    By jchau in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 15, 2008, 7:30 AM

Posting Permissions