Page 8 of 8 FirstFirst ... 678
Results 71 to 78 of 78

Thread: Grid Filter Menu

  1. #71
    Touch Premium Member Clayton's Avatar
    Join Date
    May 2007
    Posts
    49

    Default

    Hi Guys,

    Great work with this filtering project. I've finally got a version implemented on an application I'm working on. I popped it into an ext-2.0 site, and had to make a few changes. Hopefully this will save someone a bit of time ;-)

    Firstly, because the header context menus aren't "right-clicked", I tied into the "beforeshow" event of the context menu.

    Code:
    render: function(){
            FilteredGridView.superclass.render.apply(this, arguments);
    
            this.fltrCtxEl = {
                sep:  this.hmenu.add("separator"),
                item: this.hmenu.add(new Ext.menu.CheckItem({
                    id:   "filter", 
                    text: "Filter",
                    menu: true
                }))
            };
            this.fltrCtxEl.item.on('checkchange', function(item, val){this.activeFilter.setActive(val);}, this);
            
            this.hmenu.on('beforeshow', this.beforeshow, this);
    
              .........
    The "beforeshow" function takes the place of the "handleHdCtx" function.

    Code:
    beforeshow: function(){
    
            // This no longer takes the "index" parameter, but we can access it through
            // the activeHdIndex property.
            var index = this.activeHdIndex;
            var i = this.fltrCtxEl.item;
            var f = this.cm.config[index].filter;
            
            if(f == null) {
                this.setFilterMenuItemsVisible(false);
                return;
            }
            f.headerIndex = index;
            i.setChecked(f.enabled, true);
            i.menu = f.getMenu();
            
            this.setFilterMenuItemsVisible(true);
            
            this.activeFilter = f;
        },
    There was also the updating of a few deprecated properties, etc (grid.dataSource --> grid.store), but setting the "beforeshow" event took me awhile to figure out, so I thought I'd share.

    I'm new to Ext, so I'm not sure if this was the best way to go about things, but it seems to work on this end.

    Also, I'm trying to phase out prototype.js functions. bind() --> createDelegate(), each() --> Ext.each(). I'm having trouble with prototype's find command. Is there something similar in Ext, or has anyone implemented an equivalent?

    Thanks!

  2. #72
    Ext JS Premium Member ambience's Avatar
    Join Date
    Mar 2007
    Location
    Denver, CO
    Posts
    136

    Default

    Hey, thanks for working with them =) Unfortunately, I am about 85% done refactoring to an Ext 2.0 Grid Plugin. Sorry I didn't say anything sooner. I will be posting the new code and hopefully an example in the next day or so. Changes will be small, but the configuration specification has changed slightly and the store and view have been merged into a plugin. This will allow you to leverage the GroupableView and Store (I hope).

  3. #73
    Touch Premium Member Clayton's Avatar
    Join Date
    May 2007
    Posts
    49

    Default

    Awesome, ambience! S'ok, was a good learning experience :-)

  4. #74
    Ext JS Premium Member ambience's Avatar
    Join Date
    Mar 2007
    Location
    Denver, CO
    Posts
    136

    Default 2.0 Version

    New thread for the 2.0 Version: http://extjs.com/forum/showthread.php?p=70377

  5. #75
    Ext JS Premium Member
    Join Date
    Jan 2008
    Location
    Virginia
    Posts
    34

    Default

    Any way to show on the column header some sort of status if a filter is active on that column without having to click on the dropdown?

  6. #76
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Default

    Here's a 2.0 Rule I use for that purpose. Tweak to suite you needs:

    HTML Code:
    .x-grid3-hd-row td.ux-filtered-column div {   
           background: url(../resources/images/find.png) no-repeat scroll right 2px ;
           font-style: italic;  
            font-weight: bold;
            padding-right:20px;
             background-color:#98fb98;
        }
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  7. #77
    Ext User
    Join Date
    Sep 2008
    Posts
    1

    Default Cant find JsonResponseReader.js file

    Hi everybody !
    I downloaded Grid filter demo and run, but I see that I can't find JsonResponseReader.js file in my folder. Where can I find that file. I tried to find in internet but no result. Who can help me to find that file ?

    Thanks a lot !
    CR7

  8. #78
    Ext User jclawson's Avatar
    Join Date
    Mar 2007
    Location
    Denver, Colorado
    Posts
    145

    Default

    JsonResponseReader is a custom implementation of JsonReader. We wrap all of our Json data responses coming back from the server in a common object that indicates error code, exceptions, message, and other metaData. You can just use a regular Ext JsonReader.

Page 8 of 8 FirstFirst ... 678

Similar Threads

  1. Paged Grid Filter Field
    By JeffHowden in forum Community Discussion
    Replies: 38
    Last Post: 1 Jan 2009, 8:59 AM
  2. creating stationary filter row on row0 of grid
    By ianfer in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 26 Mar 2007, 5:08 AM
  3. Filter the grid
    By Greeens in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 13 Feb 2007, 11:17 AM
  4. Using Filter()
    By irishdunn in forum Ext 1.x: Help & Discussion
    Replies: 10
    Last Post: 19 Oct 2006, 5:20 AM
  5. Filter and query
    By pje in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 28 Sep 2006, 9:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •