Hide/Show FilterHeader Plugin

  1. #1

    Hide/Show FilterHeader Plugin

    Hi,

    i have a problem with the plugin FilterHeader

    <ext:Button ID="cmdShowFilters" runat="server" Icon="Magnifier" Margins="0 0 0 15">
            <DirectEvents>
                   <Click OnEvent="cmdShowFilters_DirectClick" />
            </DirectEvents>
    </ext:Button>
    ...
    ...
    ...

     <Plugins>
           <ext:FilterHeader ID="FilterHeaderAddress" runat="server" OnCreateFilterableField="OnCreateFilterableField" />
    </Plugins>
    How can i set FilterHeaderAddress visible or not visible in cmdShowFilters_DirectClick(...) ?

    Thank you very much.
    Last edited by geoffrey.mcgill; Dec 24, 2013 at 2:50 AM. Reason: Please use [CODE] tags
  2. #2

    Have anyone any idea?

    I made some tests but with no results!
  3. #3

    Solution

    OK, i found one solution. (with auto * in the the search)

    protected void cmdFilterIndirizzi_DirectClick(object sender, DirectEventArgs e)
            {
                if (e.ExtraParams["FILTERHEADER_VISIBLE"] ?? "N") == "Y")
                {
                    cmdFilterIndirizzi.Tag = "N";
                }
                else
                {
                    cmdFilterIndirizzi.Tag = "Y";
    
                    FilterHeader oFH = new FilterHeader();
                    oFH.CreateFilterableField += OnCreateFilterableField;
    
                    GridPanelIndirizzi.Plugins.Add(oFH);
    
                    RowSelectionModel oRSM = this.GridPanelIndirizzi.SelectionModel.Primary as RowSelectionModel;
                    oRSM.SelectedRows.Clear();
                    oRSM.UpdateSelection();
                }
    
                GridPanelIndirizzi.Render();
            }
    
    
    protected Field OnCreateFilterableField(object sender, ColumnBase column, Field defaultField) 
            {
                if (column.DataIndex == "Descrizione") 
                { 
                    ((TextField)defaultField).Icon = Icon.Magnifier;
    
                    defaultField.CustomConfig.Add(new ConfigItem("getValue", "getIndirizzoConAsteriscoPerRicerca", ParameterMode.Raw));
                } 
                return defaultField; 
            }
     function getIndirizzoConAsteriscoPerRicerca() { var value = this.getRawValue(); if (value && value[0] !== "*" && !Ext.net.FilterHeader.behaviour.getBehaviour("string", value)) { return "*" + value; } return value; }
    And in the GridPanel:

    <TopBar>
           <ext:Toolbar ID="Toolbar2" runat="server">
                  <Items>
    
                       <ext:Button ID="cmdFilterIndirizzi" runat="server" Icon="Magnifier" Margins="0 0 0 15">
                            <DirectEvents>
                                <Click OnEvent="cmdFilterIndirizzi_DirectClick">
                                  <EventMask ShowMask="true" Msg="Loading..." MinDelay="100" Target="CustomTarget" CustomTarget="#{GridPanelIndirizzi}" />
                                   <ExtraParams>
                                           <ext:Parameter Name="FILTERHEADER_VISIBLE" Value="#{cmdFilterIndirizzi}.tag" Mode="Raw" />
                                   </ExtraParams>
                                  </Click>
                             </DirectEvents>
                         </ext:Button>
                  </Items>
             </ext:Toolbar>
     </TopBar>
    and Plugins without FilterHeader in aspx

     <Plugins>
           <ext:CellEditing ID="CellEditingItems" runat="server">
                <Listeners>
                     <Edit Fn="editIndirizzo" />
                 </Listeners>
           </ext:CellEditing>
    </Plugins>
    Bye
    Last edited by ADV; Dec 24, 2013 at 3:14 AM.

Similar Threads

  1. Replies: 1
    Last Post: Nov 23, 2013, 4:09 PM
  2. Replies: 4
    Last Post: Nov 19, 2013, 2:11 PM
  3. [CLOSED] FilterHeader Plugin Error
    By leonardm in forum 2.x Premium Help
    Replies: 2
    Last Post: Aug 21, 2013, 5:53 PM
  4. [CLOSED] Hide show Split bar
    By legaldiscovery in forum 1.x Premium Help
    Replies: 4
    Last Post: Aug 09, 2013, 7:32 PM
  5. Show/Hide tabs
    By stone216 in forum 1.x Help
    Replies: 2
    Last Post: Oct 01, 2009, 9:21 PM

Tags for this Thread

Posting Permissions