[CLOSED] GridPanel with grouping and group command

  1. #1

    [CLOSED] GridPanel with grouping and group command

    Hello.

    I faced with following issue. I have grid with grouping feature and with group command. If grouped column contains data with quote, then error is occured. I found out that problem is a wrong id, generated by view. see example below
    <tr id="gridview-1010-bd-3m " co" class="x-grid-group-body ">

    I created an example to reproduce this issue base on ArrayGrid example:
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Store1.DataSource = this.Data;
                this.Store1.DataBind();
            }
        }
    
        private object[] Data
        {
            get
            {
                return new object[]
                {
                    new object[] { "3m \" Co", 71.72 }
                };
            }
        }
    </script>
    
    <!DOCTYPE html>
    
    <html>
    <head id="Head1" runat="server">
        <title>Simple Array Grid - Ext.NET Examples</title>
        <link href="/resources/css/examples.css" rel="stylesheet" />    
    
        <style>
            .x-grid-row-over .x-grid-cell-inner {
                font-weight : bold;
            }
        </style>
    
        <script>
            var template = '<span style="color:{0};">{1}</span>';
    
            var change = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value);
            };
    
            var pctChange = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value + "%");
            };
        </script>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        
        <h1>Simple Array Grid</h1>
        
        <ext:GridPanel 
            ID="GridPanel1"
            runat="server" 
            Title="Array Grid" 
            Width="600" 
            Height="350">
            <Store>
                <ext:Store ID="Store1" runat="server">
                    <Model>
                        <ext:Model ID="Model1" runat="server">
                            <Fields>
                                <ext:ModelField Name="company" />
                                <ext:ModelField Name="price" Type="Float" />
                            </Fields>
                        </ext:Model>
                    </Model>
                    <Groupers>
                        <ext:DataSorter Property="company" />
                    </Groupers>
                </ext:Store>
            </Store>
            <Features>
                <ext:Grouping runat="server" />
            </Features>
            <ColumnModel>
                <Columns>
                    <ext:Column ID="Column1" runat="server" Text="Company" DataIndex="company" Flex="1" />
                    <ext:Column ID="Column2" runat="server" Text="Price" DataIndex="price">                  
                        <Renderer Format="UsMoney" />
                    </ext:Column>
                    <ext:CommandColumn ID="CommandColumn2" runat="server" Hidden="true" Width="10" >
                            <GroupCommands>
                                <ext:GridCommand CommandName="SelectGroup" Text="Select&nbsp;&nbsp;Group&nbsp;&nbsp;" >
                                </ext:GridCommand>
                            </GroupCommands>
                        </ext:CommandColumn>
                </Columns>
            </ColumnModel>       
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
            </SelectionModel>
        </ext:GridPanel>
    </body>
    </html>
    Could you suggest a way to fix this?

    Best regards.
    Last edited by Daniil; Dec 29, 2012 at 1:11 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I am unable to reproduce it with the trunk sources.

    Do you have a chance to update?
  3. #3
    I checked, and this issue is not really reproducible with sources from trunk.
    Unfortunately, my project is would be released soon, and it is too risky to update ext.net at this moment of time. Could you suggets any work around?

    Best regards.
  4. #4
    You are right. The trunk has been recently updated to ExtJS 4.2 beta. Other issues are possible.

    I will try to find a solution for you. Please clarify what exactly Ext.NET do you use? Is it an official release or specific SVN revision?

    If the second, please send the dlls to support@object.net.
  5. #5
    It is the second case. We use 4380 revision from 2.1 branch. I also sent you dlls as you asked.

    Thank you.
  6. #6
    Thank you.

    Please try the following fix. Just place this script into a page's <head>.

    Fix
    Ext.grid.feature.Grouping.override({
        getFeatureTpl: function(values, parent, x, xcount) {
            return [
                '<tpl if="typeof rows !== \'undefined\'">',
                    // group row tpl
                    '<tr id="{groupHeaderId:htmlEncode}" class="' + Ext.baseCSSPrefix + 'grid-group-hd {hdCollapsedCls} {collapsibleClass}"><td class="' + Ext.baseCSSPrefix + 'grid-cell" colspan="' + parent.columns.length + '" {[this.indentByDepth(values)]}><div class="' + Ext.baseCSSPrefix + 'grid-cell-inner"><div class="' + Ext.baseCSSPrefix + 'grid-group-title">{collapsed}{[this.renderGroupHeaderTpl(values, parent)]}</div></div></td></tr>',
                    // this is the rowbody
                    '<tr id="{groupBodyId:htmlEncode}" class="' + Ext.baseCSSPrefix + 'grid-group-body {collapsedCls}"><td colspan="' + parent.columns.length + '">{[this.recurse(values)]}</td></tr>',
                '</tpl>'
            ].join('');
        }
    });

Similar Threads

  1. Command Group Gridpanel select / deselect
    By billy in forum 2.x Help
    Replies: 2
    Last Post: Nov 21, 2012, 9:16 PM
  2. GridPanel Grouping - Default group?
    By Zappa in forum 1.x Help
    Replies: 2
    Last Post: Feb 16, 2012, 11:07 AM
  3. get group command toolbar
    By wp_joju in forum 1.x Help
    Replies: 1
    Last Post: Dec 14, 2010, 6:33 AM
  4. [CLOSED] [1.0] GridPanel Group Command (Menu Type ) show/hide on demand
    By webclouder in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 10, 2010, 5:04 PM
  5. GridPanel - Group Command disable ico
    By jwcelyo in forum 1.x Help
    Replies: 0
    Last Post: Nov 16, 2010, 4:06 PM

Posting Permissions