[CLOSED] Row Expander Grid Child's Row refer to Parent's

  1. #1

    [CLOSED] Row Expander Grid Child's Row refer to Parent's

    I have another question. How to make it so that the child grid on my row expander referring to it's parent grid. For example, when I expand the row on grid level 1 with ID 'CND', I'd like the child grid on level 2 to only contains rows that have the Name 'CND'.


    <%@ Page Language="vb"%>
    <%@ Import Namespace="ListView=Ext.Net.ListView"%>
    <%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
    <%@ Import Namespace="Ext.Net.Utilities"%>
    <%@ Import Namespace="System.Collections.Generic"%>
    <script runat="server">
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
            If Not ExtNet.IsAjaxRequest Then
                Store1.DataSource = New Object() {New Object() {"cnt", "Rawat Jalan Description", "Ciptakridatama Rawat Jalan"},
                                         New Object() {"mdc", "Rawat Inap Description", "Ciptakridatama Rawat Inap"},
                                         New Object() {"temdcst", "Madical Description", "Ciptakridatama Madical"}
                Store2.DataSource = New Object() {New Object() {"1", "cnt", "kesehatan"},
                                    New Object() {"2", "cnt", "Alat/ruang makan"},
                                    New Object() {"3", "cnt", "Bahan makanan"},
                                    New Object() {"3", "cnt", "Bahan makanan"},
                                    New Object() {"1", "icd", "Faktor-faktor utama yang mempengaruhi status kesehatan dan kontak dengan pelayanan kesehatan"},
                                    New Object() {"2", "icd", "Otot & Tulang"},
                                    New Object() {"3", "icd", "Kemih"},
                                    New Object() {"1", "mdc", "Analgetik Cream"},
                                    New Object() {"2", "mdc", "Analgetik Injeksi"},
                                    New Object() {"3", "mdc", "Antibiotik"}
            End If
        End Sub
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <form id="Form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
                 <ext:Store ID="Store1" runat="server">
                            <ext:Model ID="Model1" runat="server" IDProperty="ID">
                                    <ext:ModelField Name="ID" />
                                    <ext:ModelField Name="Name" />
                                    <ext:ModelField Name="Description" />
                    <ext:Store ID="Store2" runat="server">
                            <ext:Model ID="Model2" runat="server" IDProperty="ID">
                                    <ext:ModelField Name="ID" />
                                    <ext:ModelField Name="Code" />
                                    <ext:ModelField Name="Name" />
            <ext:GridPanel ID="GridPanel1"
                Title="Expander Rows with GridPanel"
                DisableSelection="true" StoreID ="Store1">
                <ColumnModel ID="ColumnModel1" runat="server">
                        <ext:Column ID="Column1" runat="server" Text="ID" DataIndex="ID" Flex="1" />
                        <ext:Column ID="Column2" runat="server" Text="Name" DataIndex="Name" Flex="1" />
                        <ext:Column ID="Column3" runat="server" Text="Description" DataIndex="Description" Flex="1" />
                <ext:RowExpander ID="RowExpander" runat="server" SwallowBodyEvents="true" Collapsible="true"
                                 AnimCollapse="true" Icon="Table" Width="600" AutoScroll="True" Border="True"
                                 Header="false" TrackMouseOver="true" Layout="FitLayout"  StripeRows="true"> 
                       <ext:TabPanel ID="TabPanel1" runat="server">                   
                                StoreID ="Store2"
                                AutoScroll="True" Border="True"
                                Header="false" TrackMouseOver="true" Layout="FitLayout">
                                   <ColumnModel ID="ColumnModel2" runat="server">
                                                   <ext:Column ID="Column5" runat ="server" ColumnID="ID" DataIndex="ID" Header="ID" Resizable="true"></ext:Column>
                                                   <ext:Column ID="Column7" runat ="server" ColumnID="Code" DataIndex="Code" Header="Code" Resizable="true"></ext:Column>
                                                   <ext:Column ID="Column9" runat ="server" ColumnID="Name" DataIndex="Name" Header="Name" Resizable="true"></ext:Column>
                                        <ext:GridView ID="GridView2" runat="server" ForceFit="false" />
                                        <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" />
                                    <ext:PagingToolbar ID="PagingToolbar2" runat="server" PageSize="10" />
    Attached Thumbnails Click image for larger version. 

Name:	1.png 
Views:	67 
Size:	21.9 KB 
ID:	11341  
    Last edited by Daniil; May 28, 2014 at 4:28 AM. Reason: [CLOSED]
  2. #2
    Hi @redi,

    I think you can listen to a RowExpander's BeforeExpand event and load the required data to the Store of the inner GridPanel.

Similar Threads

  1. Replies: 8
    Last Post: Nov 28, 2013, 6:39 AM
  2. Replies: 0
    Last Post: May 13, 2011, 7:40 AM
  3. Replies: 0
    Last Post: May 13, 2011, 7:20 AM
  4. [CLOSED] row expander - problem grid child width
    By 78fede78 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 15, 2010, 12:31 PM
  5. Replies: 0
    Last Post: Jun 23, 2010, 3:19 PM

Tags for this Thread

Posting Permissions