Results 1 to 8 of 8

Thread: ux.grid.filter.ListFilter doesn't fire load on associated Store

  1. #1
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,501

    Default ux.grid.filter.ListFilter doesn't fire load on associated Store

    After figthing some time with ux.grid.filter.ListFilter I figure out how to configure with store in MVC view.

    I create the store before setting the filter to the grid in initComponents() methid but when filter is shown it only registers a listener for load event in store but store isn't loaded and filter option just shows "Loading..."

    I look at the code and found that show() function should trigger the store load and put a console.log() there but this function is never called.

    If I force the store to load AFTER the filter was showed the list is refreshed from the store since the listener doest what it suppouse to do.

    Do I'm missing something?

    Maybe a bug?

    Regards.
    UI: Sencha Architect / ExtJS 4 - 6
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: WildFly / Weblogic
    Databases: Oracle
    / MySQL / DB2 / Firebird

    If you like my answer please vote!

  2. #2
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,501

    Default

    Bump.

    Somebody please give me some ligth on how to track this issue.

    Regards.
    UI: Sencha Architect / ExtJS 4 - 6
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: WildFly / Weblogic
    Databases: Oracle
    / MySQL / DB2 / Firebird

    If you like my answer please vote!

  3. #3
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,501

    Default

    Well, I'm tracking this the best I can and found that Ext.ux.grid.menu.ListMenu.show() is never called with arguments so never triggers store load. I traced to here:

    Anonymous function in extjs-debug.js (line 2109) calls

    Ext.menu.Item (line 209):

    PHP Code:
        deferExpandMenu: function() {
            var 
    me this;
            
            if (!
    me.menu.rendered || !me.menu.isVisible()) {
                
    me.parentMenu.activeChild me.menu;
                
    me.menu.parentItem me;
                
    me.menu.parentMenu me.menu.ownerCt me.parentMenu;
                
    me.menu.showBy(meme.menuAlign);
            }
        }, 
    Which calls showBy() in Ext.menu.Menu (line 527) which in turns calls show() of ListMenu without parameters:

    PHP Code:
        showBy: function(cmpposoff) {
            var 
    me this;

            if (
    me.floating && cmp) {
                
    me.layout.autoSize true;
                
    me.show();

                
    // Component or Element
                
    cmp cmp.el || cmp;

                
    // Convert absolute to floatParent-relative coordinates if necessary.
                
    var xy me.el.getAlignToXY(cmppos || me.defaultAlignoff);
                if (
    me.floatParent) {
                    var 
    me.floatParent.getTargetEl().getViewRegion();
                    
    xy[0] -= r.x;
                    
    xy[1] -= r.y;
                }
                
    me.showAt(xy);
                
    me.doConstrain();
            }
            return 
    me;
        }, 
    Question:
    Is a bug in showBy() code or ListMenu should use other way to signal that show() was called from onLoad() and not from inherited menu code to avoid circular calls?

    Regards.
    UI: Sencha Architect / ExtJS 4 - 6
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: WildFly / Weblogic
    Databases: Oracle
    / MySQL / DB2 / Firebird

    If you like my answer please vote!

  4. #4
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,501

    Default

    FWIW, I changed Ext.ux.grid.menu.ListMenu.show() to this:

    PHP Code:
        show : function () {
            var 
    lastArgs null;
            return function(){
                if (
    this.loadOnShow && !this.loaded) {
                    
    this.store.load();
                    
    this.callParent(lastArgs);
                } else {
                    
    this.callParent(lastArgs);
                }
            };
        }(), 
    It seems working.

    BTW, I'm reporting as bug linking to this thread.

    Regards.
    UI: Sencha Architect / ExtJS 4 - 6
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: WildFly / Weblogic
    Databases: Oracle
    / MySQL / DB2 / Firebird

    If you like my answer please vote!

  5. #5

    Default

    Hi !

    I've been tracking that issue in my project for a day !

    I've got exactly the same problem : the store doesn't load even if the parameter loadOnShow is set to true. The show() function from ListMenu.js is called, but WITHOUT arguments, and then the condition arguments.length === 0 is true, and the store is not loaded.

    I'm wondering why there is this condition. Maybe to avoid the store being loaded several times if the filter's menu is shown several times. But without that condition, the store is never loaded several times...

    I used the same fix as you before searching some threads about that issue.

    Do you think this really is an issue and that it will be fixed by the dev team ?

    Regards !

  6. #6
    Touch Premium Member
    Join Date
    May 2010
    Posts
    8

    Default

    Is there any ticket created for this bug?

  7. #7
    Sencha User
    Join Date
    Apr 2008
    Posts
    36

    Default

    @yozik04: See http://www.sencha.com/forum/showthre...ociated-Store&

    Doesn't seem to fixed in 4.0.7, but the mentioned fix works for me.

  8. #8
    Sencha - Services Team Stju's Avatar
    Join Date
    Dec 2008
    Location
    Redwood city, California
    Posts
    293

    Default

    Fix :
    Code:
    Ext.override(Ext.ux.grid.menu.ListMenu,{
            show : function () {
                var lastArgs = null;
                return function(){
                    if(!arguments){
                        this.callParent(lastArgs);
                    } else {
                        lastArgs = arguments;
                        if (this.loadOnShow && !this.loaded) {
                            this.store.load();
                        }
                        this.callParent(arguments);
                    }
                };
            }()
        });

Similar Threads

  1. Ext.ux.grid.filter.ListFilter for null values?
    By shsu in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 27 May 2011, 6:42 AM
  2. Replies: 0
    Last Post: 12 Oct 2010, 5:44 AM
  3. [CLOSED][3.0.0] Data Store doesn't fire load event
    By mschwartz in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 26 Aug 2009, 6:56 AM
  4. Ext.ux.grid.filter.ListFilter -> loaded store
    By tobiu in forum Ext 2.x: User Extensions and Plugins
    Replies: 2
    Last Post: 31 Mar 2009, 2:23 AM
  5. fire store on load event directly on grid ?
    By mysticav in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 20 Nov 2008, 9:30 PM

Posting Permissions

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