[FIXED] [v0.8.1] groupBy parameter is not cleared on AjaxEvent when ungrouping

  1. #1

    [FIXED] [v0.8.1] groupBy parameter is not cleared on AjaxEvent when ungrouping

    Hi,

    I use Store.RemoteGroup set to true and when I ungroup fields (by unchecking 'Show in Groups' checkbox from the column header menu), the event OnRefreshData is called (which is good), but e.Parameters["groupBy"] still holds the grouped column value (I believe it should be empty). This causes my server side code to act as on grouping.


    Regards,
    Tadeusz
  2. #2

    RE: [FIXED] [v0.8.1] groupBy parameter is not cleared on AjaxEvent when ungrouping

    Hi,

    How are you set this (groupBy) parameter?
  3. #3

    RE: [FIXED] [v0.8.1] groupBy parameter is not cleared on AjaxEvent when ungrouping

    Hi,

    I don't. Coolite does it automatically when RemoteGroup="true" is set for the Store. It sets "groupBy" parameter for the StoreRefreshDataEventArgs.

    Tadeusz


  4. #4

    RE: [FIXED] [v0.8.1] groupBy parameter is not cleared on AjaxEvent when ungrouping

    Hi,

    Can you show an example which reproduces the error? For all works fine, if unchecking 'Show in Groups' the groupBy params is absent in request

    Here is my test case (without real grouping)
    <%@ Page Language="C#" %>
    <%@ Import Namespace="Coolite.Examples.Examples.GridPanel.Shared"%>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>GridPanel GroupingView with EnableRowBody - Coolite Toolkit Examples</title>
        <link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />    
        
        <script runat="server">
            
            protected void Page_Load(object sender, EventArgs e)
            {
                if(!Ext.IsAjaxRequest)
                {
                    Data_Bind();
                }
            }
            
            private void Data_Bind()
            {
                Store1.DataSource = Plant.TestData;
                Store1.DataBind();
            }
            
            protected void Refresh_Data(object sender, StoreRefreshDataEventArgs e)
            {
                Data_Bind();
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
    
            <ext:Store runat="server" ID="Store1" GroupField="Light" OnRefreshData="Refresh_Data" RemoteGroup="true">
                <Proxy>
                    <ext:DataSourceProxy></ext:DataSourceProxy>
                </Proxy>
                <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="Common" />
                            <ext:RecordField Name="Botanical" />
                            <ext:RecordField Name="Zone" Type="Int" />
                            <ext:RecordField Name="ColorCode" />
                            <ext:RecordField Name="Light" />
                            <ext:RecordField Name="Price" Type="Float" />
                            <ext:RecordField Name="Availability" Type="Date" />
                            <ext:RecordField Name="Indoor" Type="Boolean" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
                <SortInfo Field="Common" Direction="ASC" />
            </ext:Store>
            
            <ext:GridPanel
                ID="GridPanel1"
                runat="server" 
                Collapsible="true" 
                Width="600" 
                Height="350" 
                AutoExpandColumn="Common" 
                Title="Plants" 
                Frame="true" 
                StoreID="Store1">
                <ColumnModel runat="server">
                <Columns>
                    <ext:Column ColumnID="Common" Header="Common Name" DataIndex="Common" Width="220" Sortable="true" />
                    <ext:Column Header="Light" DataIndex="Light" Width="130" Sortable="true" />
                    <ext:Column Header="Price" DataIndex="Price" Width="70" Align="right" Sortable="true" Groupable="false">
                        <Renderer Format="UsMoney" />
                    </ext:Column>
                    <ext:Column Header="Available" DataIndex="Availability" Width="95" Sortable="true" Groupable="false">
                        <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                    </ext:Column>
                    <ext:Column Header="Indoor?" DataIndex="Indoor" Width="55" Sortable="true" />
                </Columns>
                </ColumnModel>
                <LoadMask ShowMask="true" />
                <SelectionModel>
                    <ext:RowSelectionModel runat="server" />
                </SelectionModel>
                <View>
                    <ext:GroupingView  
                        ID="GroupingView1"
                        runat="server" 
                        >
                    </ext:GroupingView>
                </View>
            </ext:GridPanel>
        </form>
    </body>
    </html>
  5. #5

    RE: [FIXED] [v0.8.1] groupBy parameter is not cleared on AjaxEvent when ungrouping

    Hi,

    I think it has something to do with paging and autoload parameters. To replicate the problem, in the example below, group by Light and then ungroup e.g. by unchecking 'Show in Groups' on Price. groupBy should be present in Refresh_Data.

    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="Coolite.Examples.Examples.GridPanel.Shared" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>GridPanel GroupingView with EnableRowBody - Coolite Toolkit Examples</title>
        <link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />
    
        <script runat="server">
            
            protected void Page_Load( object sender, EventArgs e )
            {
                if ( !Ext.IsAjaxRequest )
                {
                    Data_Bind();
                }
            }
    
            private void Data_Bind()
            {
                Store1.DataSource = Plant.TestData;
                Store1.DataBind();
            }
    
            protected void Refresh_Data( object sender, StoreRefreshDataEventArgs e )
            {
                Data_Bind();
            }
        </script>
    
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ScriptManager ID="ScriptManager1" runat="server" />
        <ext:Store runat="server" ID="Store1" OnRefreshData="Refresh_Data" RemoteGroup="true" RemoteSort="true">
            <AutoLoadParams>
                <ext:Parameter Name="start" Value="={0}" />
                <ext:Parameter Name="limit" Value="={100}" />
            </AutoLoadParams>
            <Proxy>
                <ext:DataSourceProxy>
                </ext:DataSourceProxy>
            </Proxy>
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="Common" />
                        <ext:RecordField Name="Botanical" />
                        <ext:RecordField Name="Zone" Type="Int" />
                        <ext:RecordField Name="ColorCode" />
                        <ext:RecordField Name="Light" />
                        <ext:RecordField Name="Price" Type="Float" />
                        <ext:RecordField Name="Availability" Type="Date" />
                        <ext:RecordField Name="Indoor" Type="Boolean" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
            <SortInfo Field="Common" Direction="ASC" />
        </ext:Store>
        <ext:GridPanel ID="GridPanel1" runat="server" Collapsible="true" Width="600" Height="350" AutoExpandColumn="Common" Title="Plants" Frame="true" StoreID="Store1">
            <ColumnModel ID="ColumnModel1" runat="server">
                <Columns>
                    <ext:Column ColumnID="Common" Header="Common Name" DataIndex="Common" Width="220" Sortable="true" />
                    <ext:Column Header="Light" DataIndex="Light" Width="130" Sortable="true" />
                    <ext:Column Header="Price" DataIndex="Price" Width="70" Align="right" Sortable="true" Groupable="false">
                        <Renderer Format="UsMoney" />
                    </ext:Column>
                    <ext:Column Header="Available" DataIndex="Availability" Width="95" Sortable="true" Groupable="false">
                        <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                    </ext:Column>
                    <ext:Column Header="Indoor?" DataIndex="Indoor" Width="55" Sortable="true" />
                </Columns>
            </ColumnModel>
            <LoadMask ShowMask="true" />
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
            </SelectionModel>
            <View>
                <ext:GroupingView ID="GroupingView1" HideGroupedColumn="true" runat="server" ForceFit="true" StartCollapsed="false" GroupTextTpl="{text}" EnableRowBody="true">
                </ext:GroupingView>
            </View>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" StoreID="Store1" DisplayInfo="true" DisplayMsg="Displaying plants {0} - {1} of {2}" EmptyMsg="No plants to display" />
            </BottomBar>
        </ext:GridPanel>
        </form>
    </body>
    </html>
    Regards,
    Tadeusz
  6. #6

    RE: [FIXED] [v0.8.1] groupBy parameter is not cleared on AjaxEvent when ungrouping

    Hi,

    Fixed. Please update from SVN
  7. #7

    RE: [FIXED] [v0.8.1] groupBy parameter is not cleared on AjaxEvent when ungrouping

    Thank you.

Similar Threads

  1. [FIXED] DisabledDates not cleared
    By wazige in forum Bugs
    Replies: 2
    Last Post: Mar 11, 2011, 1:21 PM
  2. ajaxevent parameter
    By [WP]joju in forum 1.x Help
    Replies: 0
    Last Post: Oct 30, 2009, 3:08 AM
  3. [FIXED] [V0.8.0] Bug in Coolite.AjaxEvent
    By abertram in forum Bugs
    Replies: 5
    Last Post: Jan 23, 2009, 10:52 AM
  4. Replies: 4
    Last Post: Oct 03, 2008, 3:06 PM
  5. [FIXED] [V0.6] AjaxEvent not working
    By Jurke in forum Bugs
    Replies: 3
    Last Post: Sep 09, 2008, 11:13 AM

Posting Permissions