[CLOSED] switch column data within a grid panel using grid header filters

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] switch column data within a grid panel using grid header filters

    In our current application, we are using a standard ASP grid control. We can search for specific records saved in our DB, and then we can switch column data that displays using a grid header filter (please see attachment).

    We are currently looking at your multi header grid filter to try and accomplish the same functionality (https://examples1.ext.net/#/GridPane...Header/Filter/).

    This is proving to be very difficult. Any suggestions would be greatly appreciated. We are stuck right now trying to implement this functionality using your controls.

    I can copy our current code for this page if you like.
    Attached Thumbnails Click image for larger version. 

Name:	switch grid results from filter selection in grid header.png 
Views:	446 
Size:	99.2 KB 
ID:	2332  
    Last edited by Daniil; Mar 01, 2011 at 10:25 AM. Reason: [CLOSED]
  2. #2

    current project code

    According to the EXT multi header grid control example, the filters are only filtering data that is displaying in the result panel. We need to add custom filters in order to switch column data from one data category, to another data category. the same records display however the data in a specified column will show different data based on the filter selection of a given data category.

    Below is the code for our current project using EXT multi header grid control. Our filters in the header are displaying the correct column data categories however when we try to switch from one category to another...Nothing happens.

    All data of store1, store2, store3, store4 and store5 are populating in code behind.

    <ext:Store ID="Store1" runat="server" OnRefreshData="Store1_RefreshData">
            <Reader>
                <ext:JsonReader IDProperty="Application_Id">
                    <Fields>
                        <ext:RecordField Name="Application_Id" />
                        <ext:RecordField Name="BName" />
                        <ext:RecordField Name="UserName" />
                        <ext:RecordField Name="LoanInfo" />
                        <ext:RecordField Name="Latest_date" />
                        <ext:RecordField Name="status" />
                        <ext:RecordField Name="Alert" />
                        <ext:RecordField Name="Date_started" />
                        <ext:RecordField Name="LenderAgencyID" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:Store ID="Store2" runat="server">
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="UserRoleDesc" />
                        <ext:RecordField Name="UserRoleField" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:Store ID="Store3" runat="server">
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="LoanInfoDesc" />
                        <ext:RecordField Name="LoanInfoField" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:Store ID="Store4" runat="server">
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="LoanDates" />
                        <ext:RecordField Name="LoanDateField" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
        <ext:Store ID="Store5" runat="server">
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="BorrowerDesc" />
                        <ext:RecordField Name="BorrowerType" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>  
       
       <ext:GridPanel ID="gvReg" runat="server" StoreID="Store1" AnchorHorizontal="100%"
            Height="185">
            <ColumnModel ID="ColumnModel1" runat="server">
                <Columns>
                    <ext:Column Header="Application ID" DataIndex="Application_Id" Width="80" />
                    <ext:Column Header="Borrower" DataIndex="BName" Width="160" />
                    <ext:Column Header="Originator" DataIndex="UserName" Width="160" />
                    <ext:Column Header="Loan Amount" DataIndex="LoanInfo" Width="160" />
                    <ext:Column Header="Updated date" DataIndex="Latest_date" Width="160" />
                    <ext:Column Header="Loan Status" DataIndex="status" Width="100" />
                    <ext:Column Header="Alert" DataIndex="Alert" Width="100" />
                    <ext:Column Header="Start Date" DataIndex="Date_started" Width="140" />
                    <ext:Column Header="Lender Agency" DataIndex="LenderAgencyID" Width="100" />
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
            </SelectionModel>
            <LoadMask ShowMask="true" />
            <View>
                <ext:GridView ID="GridView1" runat="server">
                    <HeaderRows>
                        <ext:HeaderRow>
                            <Columns>
                                <ext:HeaderColumn>
                                    <Component>
                                        <ext:Label ID="lblEmpty" runat="server">
                                        </ext:Label>
                                    </Component>
                                </ext:HeaderColumn>
                                <ext:HeaderColumn>
                                    <Component>
                                        <ext:Label ID="Label5" runat="server">
                                        </ext:Label>
                                    </Component>
                                </ext:HeaderColumn>
                                <ext:HeaderColumn>
                                    <Component>
                                        <ext:ComboBox ID="ddlBorrower" runat="server" TriggerAction="All" Mode="Local" DisplayField="BorrowerDesc"
                                            ValueField="BorrowerType" StoreID="Store5" AutoPostBack="true">
                                        </ext:ComboBox>
                                    </Component>
                                </ext:HeaderColumn>
                                <ext:HeaderColumn>
                                    <Component>
                                        <ext:ComboBox ID="ddlUserRoles" runat="server" TriggerAction="All" Mode="Local" DisplayField="UserRoleDesc"
                                            ValueField="UserRoleField" StoreID="Store2" AutoPostBack="true">
                                        </ext:ComboBox>
                                    </Component>
                                </ext:HeaderColumn>
                                <ext:HeaderColumn>
                                    <Component>
                                        <ext:ComboBox ID="ddlLoanInfo" runat="server" TriggerAction="All" Mode="Local" DisplayField="LoanInfoDesc"
                                            ValueField="LoanInfoField" StoreID="Store3" AutoPostBack="true">
                                        </ext:ComboBox>
                                    </Component>
                                </ext:HeaderColumn>
                                <ext:HeaderColumn>
                                    <Component>
                                        <ext:ComboBox ID="ddlLoanDates" runat="server" TriggerAction="All" Mode="Local" DisplayField="LoanDates"
                                            ValueField="LoanDateField" StoreID="Store4" AutoPostBack="true">
                                        </ext:ComboBox>
                                    </Component>
                                </ext:HeaderColumn>
                                <ext:HeaderColumn>
                                    <Component>
                                        <ext:Label ID="Label2" runat="server">
                                        </ext:Label>
                                    </Component>
                                </ext:HeaderColumn>
                                <ext:HeaderColumn>
                                    <Component>
                                        <ext:Label ID="Label3" runat="server">
                                        </ext:Label>
                                    </Component>
                                </ext:HeaderColumn>
                                <ext:HeaderColumn>
                                    <Component>
                                        <ext:Label ID="Label4" runat="server">
                                        </ext:Label>
                                    </Component>
                                </ext:HeaderColumn>
                                <ext:HeaderColumn>
                                    <Component>
                                        <ext:Label ID="Label6" runat="server">
                                        </ext:Label>
                                    </Component>
                                </ext:HeaderColumn>
                            </Columns>
                        </ext:HeaderRow>
                    </HeaderRows>
                </ext:GridView>
            </View>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10">
                    <Items>
                        <ext:Label ID="Label1" runat="server" Text="Page size:" />
                        <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                        <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                            <Template Visible="False" ID="ctl474" EnableViewState="False">
                            </Template>
                            <Items>
                                <ext:ListItem Text="1" />
                                <ext:ListItem Text="2" />
                                <ext:ListItem Text="5" />
                                <ext:ListItem Text="10" />
                                <ext:ListItem Text="20" />
                            </Items>
                            <SelectedItem Value="10" />
                            <Listeners>
                                <Select Handler="#{PagingToolbar1}.pageSize = parseInt(this.getValue()); #{PagingToolbar1}.doLoad();" />
                            </Listeners>
                        </ext:ComboBox>
                    </Items>
                </ext:PagingToolbar>
            </BottomBar>
        </ext:GridPanel>
    Last edited by geoffrey.mcgill; Feb 21, 2011 at 10:07 PM. Reason: please use [CODE] tags
  3. #3
    Hi,

    Maybe it would be best to just re-render the GridPanel when you switch columns. On a DirectEvent, just call .Render() on the GridPanel object.

    Please wrap your code sample in [CODE] tags, see #3 at the following location:

    http://forums.ext.net/showthread.php...ation-Required

    Hope this helps.
    Geoffrey McGill
    Founder
  4. #4
  5. #5
    Quote Originally Posted by Daniil View Post

    This does not work...When we try to load the new column data from a filter in the column header, we get an error message (Error: 'this.view.headerRows' is null or not an object).

    
    Dim store As Store = Me.Store1        
    Dim gvGrid As GridPanel = Me.gvReg        
    store.Reader.Clear()       
    gvGrid.SelectionModel.Clear()        
    store.DataSource = GetSearchDataTable(sStatusList)        
    store.DataBind()        
    gvGrid.Render()
    Attached Thumbnails Click image for larger version. 

Name:	switch column data.png 
Views:	260 
Size:	52.1 KB 
ID:	2333   Click image for larger version. 

Name:	error message.JPG 
Views:	234 
Size:	9.3 KB 
ID:	2334  
  6. #6
    Quote Originally Posted by geoffrey.mcgill View Post
    Hi,

    Maybe it would be best to just re-render the GridPanel when you switch columns. On a DirectEvent, just call .Render() on the GridPanel object.

    Please wrap your code sample in [CODE] tags, see #3 at the following location:

    http://forums.ext.net/showthread.php...ation-Required

    Hope this helps.
    This does not work...When we try to load the new column data from a filter in the column header, we get an error message (Error: 'this.view.headerRows' is null or not an object).

    Dim store As Store = Me.Store1        
    Dim gvGrid As GridPanel = Me.gvReg        
    store.Reader.Clear()       
    gvGrid.SelectionModel.Clear()        
    store.DataSource = GetSearchDataTable(sStatusList)        
    store.DataBind()        
    gvGrid.Render()
  7. #7
    Hi,

    'Render' calling is not required if you just rebind data. Do you add new fields/columns during data rebinding?
  8. #8
    Hi,

    Why do you clear Reader and SelectionModel?
  9. #9
    Quote Originally Posted by Vladimir View Post
    Hi,

    'Render' calling is not required if you just rebind data. Do you add new fields/columns during data rebinding?
    Yes...We are adding new data, along with corresponding header category.
  10. #10
    Quote Originally Posted by Vladimir View Post
    Hi,

    Why do you clear Reader and SelectionModel?

    Initially we are clearing the Reader information, and then we are adding Reader information through 'getsearchdatatable' to store objects.
Page 1 of 2 12 LastLast

Similar Threads

  1. grid panel change data from column
    By cbu in forum 1.x Help
    Replies: 2
    Last Post: Jan 03, 2012, 11:50 AM
  2. Replies: 3
    Last Post: Dec 06, 2011, 6:40 AM
  3. Grid panel column header localization
    By reezvi in forum 1.x Help
    Replies: 5
    Last Post: Aug 08, 2011, 9:57 AM
  4. [CLOSED] [1.0] Centralize Column Header Grid Panel
    By pdcase in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 01, 2010, 9:20 PM
  5. [CLOSED] Grid Panel Data Cutted in column
    By speedstepmem2 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 18, 2009, 6:09 AM

Tags for this Thread

Posting Permissions