[CLOSED] Nested Grids with checkbox selection model

  1. #1

    [CLOSED] Nested Grids with checkbox selection model

    Hi team,
    We are working on nested grids, The reference is taken from
    https://examples2.ext.net/#/GridPane...vel_GridPanel/

    We have used Checkbox selectionModel in Both parent and child grids,
    Now when I select(check) any item of the parent gird then the inner grid data is selected automatically
    How can we stop this? Any solution is helpful.

    here is the code to reproduce the issue

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm7.aspx.cs" Inherits="Ext2._2Practice.WebForm7" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" 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></title>
        <script runat="server">
            protected void Page_Load(object sender, EventArgs e)
            {
                this.Store1.DataSource = new object[]
                {
                    new object[] { "3m Co", 71.72, 0.02, 0.03, "9/1 12:00am", "Manufacturing" },
                    new object[] { "Alcoa Inc", 29.01, 0.42, 1.47, "9/1 12:00am", "Manufacturing" },
                    new object[] { "Altria Group Inc", 83.81, 0.28, 0.34, "9/1 12:00am", "Manufacturing" },
                    new object[] { "American Express Company", 52.55, 0.01, 0.02, "9/1 12:00am", "Finance" }
                };
    
    
                this.Store1.DataBind();
                this.storeInner.DataSource = new object[]
                {
                    new object[] { 1204, "First"},
                    new object[] { 1505,"Second" },
                    new object[] { 2564, "Third"}
                  
                };
                this.storeInner.DataBind();
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:GridPanel ID="GridPanel1" runat="server" Title="RowExpander" Collapsible="true"
            AnimCollapse="true" Icon="Table" Width="600" Height="600">
            <Store>
                <ext:Store ID="Store1" runat="server">
                    <Model>
                        <ext:Model runat="server">
                            <Fields>
                                <ext:ModelField Name="company" />
                                <ext:ModelField Name="price" Type="Float" />
                                <ext:ModelField Name="change" Type="Float" />
                                <ext:ModelField Name="pctChange" Type="Float" />
                                <ext:ModelField Name="lastChange" Type="Date" DateFormat="M/d hh:mmtt" />
                                <ext:ModelField Name="industry" />
                                <ext:ModelField Name="desc" />
                            </Fields>
                        </ext:Model>
                    </Model>
                </ext:Store>
            </Store>
            <ColumnModel runat="server">
                <Columns>
                    <ext:Column runat="server" Text="Company" DataIndex="company" Flex="1" />
                    <ext:Column runat="server" Text="Price" DataIndex="price">
                        <Renderer Format="UsMoney" />
                    </ext:Column>
                    <ext:Column runat="server" Text="Change" DataIndex="change">
                    </ext:Column>
                    <ext:Column runat="server" Text="Change" DataIndex="pctChange">
                    </ext:Column>
                    <ext:DateColumn runat="server" Text="Last Updated" DataIndex="lastChange" />
                </Columns>
            </ColumnModel>
            <View>
                <ext:GridView runat="server" TrackOver="true" />
            </View>
            <SelectionModel>
                <ext:CheckboxSelectionModel RowSpan="2" CheckOnly="true" runat="server" Mode="Multi" />
            </SelectionModel>
            <Plugins>
                <ext:RowExpander ID="RowExpander1" SelectRowOnExpand="false" SwallowBodyEvents="true"
                    SingleExpand="false" runat="server">
                    <Component>
                        <ext:GridPanel ID="gpInner" runat="server">
                            <Store>
                                <ext:Store ID="storeInner" runat="server">
                                    <Model>
                                        <ext:Model ID="mdlOne" runat="server" IDProperty="rId">
                                            <Fields>
                                                <ext:ModelField Name="rId" />
                                                <ext:ModelField Name="rName" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                            <ColumnModel>
                                <Columns>
                                    <ext:Column ID="clrecordName" runat="server" Flex="1" Text="Name" DataIndex="rName">
                                    </ext:Column>
                                </Columns>
                            </ColumnModel>
                            <SelectionModel>
                                <ext:CheckboxSelectionModel ID="chkInner" ShowHeaderCheckbox="false" runat="server"
                                    CheckOnly="true">
                                </ext:CheckboxSelectionModel>
                            </SelectionModel>
                        </ext:GridPanel>
                    </Component>
                </ext:RowExpander>
            </Plugins>
        </ext:GridPanel>
        </form>
    </body>
    </html>
    Please contact if you need more explanation

    Thank you
    Mohan
    Last edited by Daniil; Aug 20, 2013 at 9:11 AM. Reason: [CLOSED]
  2. #2
    Hi @mohan.bizbites,

    Please read about the known issues with nested GridPanels. They are presented in the example you mentioned.

    This one is related to your case.
    • 3. A parent and a nested GridPanels must not use row and checkbox selection models at the same time.
    Unfortunately, we have no solution for that restriction.

Similar Threads

  1. Replies: 10
    Last Post: Apr 19, 2013, 3:16 PM
  2. Replies: 2
    Last Post: Aug 09, 2011, 10:38 AM
  3. binding checkbox selection model
    By VipulTyagi in forum 1.x Help
    Replies: 2
    Last Post: Apr 07, 2011, 11:36 AM
  4. Replies: 4
    Last Post: Oct 06, 2010, 9:08 AM
  5. Checkbox selection model + getRowsValues
    By Birgit in forum 1.x Help
    Replies: 10
    Last Post: Sep 06, 2010, 5:12 PM

Tags for this Thread

Posting Permissions