[CLOSED] Grouping a grid by a column with null values breaks the grid

  1. #1

    [CLOSED] Grouping a grid by a column with null values breaks the grid

    Hello,

    we are experiencing an issue where grouping a grid by a column where a null value is found on the values breaks the rendering of the grid.

    Unfortunately we do not have an example yet, maybe you know about this issue?

    Thank you for help,
    Cheers
    Last edited by fabricio.murta; Mar 02, 2016 at 3:13 PM. Reason: no user feedback for 7+ days
  2. #2
    Hello, I don't seem to be able to reproduce this issue.

    Tried by adding records with either empty or null values. By a matter of fact, the group is not formed, but also it does not just break rendering and renders nothing, it just skips the empty/null group.

    I worked upon the example Grouping TotalRow.

    Other than that, we are not aware of a problem with grid panel's grouping like you described.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hi,

    here you go with a sample that generates the issue.

    Ext.Net version: 3.2.1
    Ext.Js Version: 5.1.1.451
    Browser: Chrome

    Steps to reproduce:
    - Click on “Task” Header
    - Click on Group By this field

    The error is:
    ext.axd?v=27471:130810 Uncaught TypeError: Cannot set property 'raw' of undefined

    The error line is:
    metaGroup.raw = group.getAt(0).get(groupField);
    View code:

    <!DOCTYPE html>
     
    <script  runat="server">
    
        Protected Sub Page_Load(sender As Object, e As EventArgs)
            
            Dim ci As New Globalization.CultureInfo("en-US")
    
            Dim store As Store = Me.GridPanel1.GetStore()
    
            store.DataSource = New List(Of Project)() From { _
                New Project(102, "Ext Grid: Summary Rows", 107, "Dynamic summary updates in editor grids", 6, 125, _
                    0, ParseExact("07/05/2007", ci)), _
                New Project(102, "Ext Grid: Summary Rows", 108, "Remote summary integration", 4, 125, _
                    0, ParseExact("07/05/2007", ci)), _
                New Project(102, "Ext Grid: Summary Rows", 109, "Summary renderers and calculators", 4, 125, _
                    0, ParseExact("07/06/2007", ci)), _
                New Project(102, "Ext Grid: Summary Rows", 110, "Integrate summaries with GroupingView", 10, 125, _
                    0, ParseExact("07/11/2007", ci)), _
                New Project(102, "Ext Grid: Summary Rows", 111, "Testing and debugging", 8, 125, _
                    0, ParseExact("07/15/2007", ci)) , _
                New Project(102, "Test Grouping null", 111, Nothing, 8,125, _
                    0, ParseExact("07/15/2007", ci)) _        
            }
    
            store.DataBind()
        End Sub
    
        Private Function ParseExact(dateString As String, ByRef culture As Globalization.CultureInfo) As DateTime
            Return DateTime.ParseExact(dateString, "MM/dd/yyyy", culture)
        End Function
    
        Public Class Project
            Public Sub New(projectId As Integer, name As String, taskId As Integer, description As String, estimate As Integer, rate As Double, _
                cost As Double, due As DateTime)
                Me.ProjectID = projectId
                Me.Name = name
                Me.TaskID = taskId
                Me.Description = description
                Me.Estimate = estimate
                Me.Rate = rate
                Me.Due = due
            End Sub
    
            Public Property ProjectID() As Integer
                Get
                    Return m_ProjectID
                End Get
                Set(value As Integer)
                    m_ProjectID = Value
                End Set
            End Property
            Private m_ProjectID As Integer
            Public Property Name() As String
                Get
                    Return m_Name
                End Get
                Set(value As String)
                    m_Name = Value
                End Set
            End Property
            Private m_Name As String
            Public Property TaskID() As Integer
                Get
                    Return m_TaskID
                End Get
                Set(value As Integer)
                    m_TaskID = Value
                End Set
            End Property
            Private m_TaskID As Integer
            Public Property Description() As String
                Get
                    Return m_Description
                End Get
                Set(value As String)
                    m_Description = Value
                End Set
            End Property
            Private m_Description As String
            Public Property Estimate() As Integer
                Get
                    Return m_Estimate
                End Get
                Set(value As Integer)
                    m_Estimate = Value
                End Set
            End Property
            Private m_Estimate As Integer
            Public Property Rate() As Double
                Get
                    Return m_Rate
                End Get
                Set(value As Double)
                    m_Rate = Value
                End Set
            End Property
            Private m_Rate As Double
            Public Property Cost() As Double
                Get
                    Return m_Cost
                End Get
                Set(value As Double)
                    m_Cost = Value
                End Set
            End Property
            Private m_Cost As Double
            Public Property Due() As DateTime
                Get
                    Return m_Due
                End Get
                Set(value As DateTime)
                    m_Due = Value
                End Set
            End Property
            Private m_Due As DateTime
        End Class
        
    </script>
    
    <html>
    <head id="Head2" runat="server">
        <title>Debug</title>
    </head>
    <body>
        <form id="Form2" runat="server">
    
            <ext:ResourceManager
                ID="ResourceManager2"
                runat="server"
                Namespace="MyNamespace"
                CleanResourceUrl="true"
                SourceFormatting="true"
                InitScriptMode="Inline"
                ScriptMode="Debug" />
    
            <ext:Viewport runat="server">
                <Items>
                    <ext:FormPanel runat="server" Width="800" MonitorResize="true" Title="FormPanel" Border="true">
                        <LayoutConfig>
                            <ext:FormLayoutConfig LabelWidth="100" />
                        </LayoutConfig>
                        <Items>
    
                            <ext:GridPanel
                                ID="GridPanel1"
                                runat="server"
                                Width="800"                            
                                Height="450">
                                <Store>
                                    <ext:Store ID="Store1" runat="server">
                                        <Sorters>
                                            <ext:DataSorter Property="Due" Direction="DESC" />
                                        </Sorters>
                                        <Model>
                                            <ext:Model ID="Model1" runat="server" IDProperty="TaskID">
                                                <Fields>
                                                    <ext:ModelField Name="ProjectID" />
                                                    <ext:ModelField Name="Name" />
                                                    <ext:ModelField Name="TaskID" />
                                                    <ext:ModelField Name="Description" />
                                                    <ext:ModelField Name="Estimate" Type="Int" />
                                                </Fields>
                                            </ext:Model>
                                        </Model>
                                    </ext:Store>
                                </Store>
                                <ColumnModel ID="ColumnModel1" runat="server">
                                    <Columns>
                                    <ext:Column ID="SummaryColumn1"
                                        runat="server"
                                        TdCls="task"
                                        Text="Task"
                                        Sortable="true"
                                        DataIndex="Description"
                                        Width="100"
                                        Hideable="false">
                                    </ext:Column>
    
                                    <ext:Column ID="Column1" runat="server" Text="Project" DataIndex="Name" Width="100" />
    
                                    <ext:Column ID="SummaryColumn3"
                                        runat="server"
                                        Width="100"
                                        Text="Estimate"
                                        Sortable="true"
                                        DataIndex="Estimate">
                                    </ext:Column>
    
                                    <ext:Column
                                        runat="server"
                                        Width="100"
                                        ID="Cost"
                                        Text="Cost"
                                        Sortable="false"
                                        Groupable="false"
                                        DataIndex="Cost">
                                    </ext:Column>                                  
                                    </Columns>
                                </ColumnModel>
                                <Features>
                                    <ext:Grouping
                                        ID="Grouping1"
                                        runat="server"
                                        HideGroupedHeader="true"
                                        StartCollapsed="false"
                                        GroupHeaderTplString='{columnName}: {name} ({rows.length})' />
                                </Features>
                            </ext:GridPanel>
                        </Items>
                    </ext:FormPanel>
                </Items>
            </ext:Viewport>
        </form>
    
    </body>
    </html>

    Thank you.
    Last edited by adrianot; Feb 22, 2016 at 3:01 PM.
  4. #4
    Hello! I've reproduced your issue! Well, in Ext.NET 3.2.1.

    Upon reproducing the issue, I just updated the Ext.NET NuGet package to 3.3.0 and the example worked just fine. So you can either update your sources to latest SVN or just update the Ext.NET DLL to version 3.3.0 (you may want to install the NuGet version, or just update the package if you already are using NuGet).

    If you cannot upgrade to Ext.Net 3.3.0 now, I'm afraid you'll have to replace the fields getting Nothing to something like "&nbsp;" in order to have the functionality in the older version yet guarantee no visual feedback. You probably will need to check the entries if you use the grid values to update back to a database (to avoid replacing empty values in DB by the &nbsp; string.

    I hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 3
    Last Post: May 22, 2015, 10:43 AM
  2. [CLOSED] Column's constrain breaks grid's layout
    By RCN in forum 3.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 09, 2015, 12:17 PM
  3. Replies: 1
    Last Post: Dec 06, 2012, 3:27 PM
  4. Replies: 4
    Last Post: Apr 05, 2012, 2:38 PM

Posting Permissions