1. #91
    Ext User
    Join Date
    Jan 2010
    Posts
    43
    Vote Rating
    0
    mpawlowski is on a distinguished road

      0  

    Default object based records

    object based records


    I was having problems with this plugin when using object based record values while specifying a sort type and a renderer.

    Code:
    //Record Value
    {
        ordinal: 1,
        text: 'foo'
    }
    Code:
    //Store Field Decleration
    {
        name: 'columnDataIndex',
        sortType: function(val){
            return val.ordinal;
        }
    }
    Code:
    //Column Model decleration
    {
        header: 'Column Header',
        dataIndex: 'columnDataIndex',
        renderer: function(val){
            return val.text
        }
    }
    Code:
    //ListFilter Decleration
    {
        type: 'list',
        dataIndex: 'columnDataIndex',
        options: ['Option1', 'Option2'],
        labelField: 'text'
    }
    This caused problems when trying to create a list filter of enumerated values. I added some functionality to the list filter to have it account for this problem. If you specify a labelField when creating the filter in the list, then the list filter looks into the object of the record value and compares the filter option to the value of the labelField inside the record value object.

    Code:
    Ext.override(Ext.ux.grid.filter.ListFilter, {
        validateRecord: function(record){
            if (this.labelField) {
                return this.getValue().indexOf(record.get(this.dataIndex)[this.labelField]) > -1;
            }
            else {
                return this.getValue().indexOf(record.get(this.dataIndex)) > -1;
            }
        }
    });
    I saw someone using the labelField value in the filter, but I didn't see it in the decleration of ListFilter.js. If that is conflicting with something else its an easy change. This is just a small hack that might help someone else with a similar issue.

    Also, if there is already a way to do this and I missed it, can someone enlighten me?
    Last edited by mpawlowski; 21 Apr 2010 at 11:01 AM. Reason: moved some stuff around

  2. #92
    Ext User
    Join Date
    Jun 2008
    Posts
    43
    Vote Rating
    0
    fulfowi is on a distinguished road

      0  

    Default "this.proxy is undefined" in GridFilters with ExtJs 3.1.1

    "this.proxy is undefined" in GridFilters with ExtJs 3.1.1


    I'm in the process of moving from ExtJs 2.0.1 to ExtJs 3.1.1. I got GridFilters to work in ExtJs 2.0.1, using examples absconded from ExtJs 2.2 with no problems. When I try to use the ExtJs 3.1.1 GridFilters examples (with ExtJs 3.1.1), every thing looks fine until I select a filter, which gives me the following trace in firebug:

    this.proxy is undefined
    anonymous("read", Object name=rs, Object params=Object, Object name=batch)ext-all-debug.js (line 33322)
    anonymous(Object params=Object)ext-all-debug.js (line 33202)
    anonymous(Object name=options)ext-all-debug.js (line 33571)
    anonymous()GridFilters.js (line 507)
    anonymous()ext-all-debug.js (line 1881)
    [Break on this error] this.proxy.request(Ext.data....ack(action, rs, batch), this, options);\next-all-debug.js (line 33322)

    At 507 in GridFilters.js it's doing a store.reload(). The grid just keeps trying to load.

    Here's my complete code for the page:

    Code:
     
    //******************************************************************************
    // $Id:  logger.js@@/main/3  2009/10/07 14:27:17  dfulford  $
    //
    // ABSTRACT:  This javascript uses extjs to implement the logger window for the 
    //            Algorithm Development Lab (ADL).
    //
    // $Log:  /source/mission64t/tgirs_webapps/logger/resources/js/logger.js  $
    //     /main/3  2009/10/07 14:27:17  dfulford
    //     TGIRS-921: See Jira Issue.
    //     /main/2  2009/03/30 10:50:20  dfulford
    //     TGIRS-565: See Jira Issue.
    //     /main/1  2009/03/25 15:52:12  dfulford
    //     TGIRS-551: See Jira Issue.
    //
    //******************************************************************************
    var RCS_HEADER = "$Header:  /source/mission64t/tgirs_webapps/logger/resources/js/logger.js@@/main/3  2009/10/07 14:27:17  dfulford  $";
    Ext.BLANK_IMAGE_URL = "images/default/s.gif";
    var UI = {};
    var DATA = {};
    // "Included" modules.
    var helpers;
    if (!helpers || !helpers.Util)
    {
        throw new Error("helpers/Util.js has not been loaded.");
    }
    var copyToClipboard = helpers.Util.copyToClipboard;
    //:MAINTENANCE: Change if changes in schema.
    DATA.LOGGING_LEVELS = "LOGGING_LEVELS";
    DATA.LOGGING_DEGREE = "LOGGING_DEGREE";
    Ext.ux.grid.filter.StringFilter.prototype.icon = 'img/find.png';
    function create()
    {
        var logMessages = [];
        var logFieldDefinitions =
             ['systemTime', 'missionTime', 'source', 'type', 'level', 'message'];
        DATA.logRecord = Ext.data.Record.create(logFieldDefinitions);
        UI.logStore = new Ext.data.SimpleStore
        ({
            fields: logFieldDefinitions,
            data: logMessages
        })
        UI.loggingLevels = 
            opener.getEnumeration("dns:"+DATA.LOGGING_LEVELS);
        UI.loggingDegree = 
            opener.getEnumeration("dns:"+DATA.LOGGING_DEGREE);
        var sources = opener.getInstances();
        sources.push('Executor');
        var types = [];
        for (var i=0; i<UI.loggingLevels.length; ++i)
        {
            types.push(UI.loggingLevels[i][0]);
        }
        var levels = [];
        for (var i=0; i<UI.loggingDegree.length; ++i)
        {
            levels.push(UI.loggingDegree[i][0]);
        }
        var filters = new Ext.ux.grid.GridFilters
        ({
            filters:
            [{
                 type: 'string',
                 dataIndex: 'systemTime'
            },{
                 type: 'string',
                 dataIndex: 'missionTime'
            },{
                 type: 'list',
                 dataIndex: 'source',
                 options: sources
            },{
                 type: 'list',
                 dataIndex: 'type',
                 options: types
            },{
                 type: 'list',
                 dataIndex: 'level',
                 options: levels
            },{
                 type: 'string',
                 dataIndex: 'message'
            }]
        });
        UI.logDisplayGrid = new Ext.grid.GridPanel
        ({
             store: UI.logStore,
             columns:
             [{
                  id: 'systemTime',
                  header: 'System Time',
                  width: 200,
                  sortable: true,
                  dataIndex: 'systemTime'
             },{
                  id: 'missionTime',
                  header: 'Mission Time',
                  width: 200,
                  sortable: true,
                  dataIndex: 'missionTime'
             },{
                  id: 'source',
                  header: 'Source',
                  width: 200,
                  sortable: true,
                  dataIndex: 'source'
             },{
                  id: 'type',
                  header: 'Type',
                  width: 75,
                  sortable: true,
                  dataIndex: 'type'
             },{
                  id: 'level',
                  header: 'Level',
                  width: 75,
                  sortable: true,
                  dataIndex: 'level'
             },{
                  id: 'message',
                  header: 'Message',
                  width: 2000,
                  sortable: true,
                  dataIndex: 'message'
             }],
             autoScroll: true,
             height: 1000,
             plugins: filters,
             region: 'center',
             loadMask:true,
             local: true
        });
        var viewport = new Ext.Viewport
        ({
            layout: 'border',
            items: [UI.logDisplayGrid]
        })
    }
    function getLogMessages()
    {
        opener.showWait("Getting log messages ...", "Couldn't get log messages.");
        Adl.getLogMessages(function(messages)
        {
            if (messages != null)
            {
                for (var i=0; i<messages.length; ++i)
                {
                    var tokens = messages[i].split("\t");
     
                    if (tokens[0] != "System Time")
                    {
                        var log = new DATA.logRecord
                        ({
                             systemTime:  tokens[0],
                             missionTime: tokens[1],
                             source:      tokens[2],
                             type:        tokens[3],
                             level:       tokens[4],
                             message:     tokens[5]
                        });
     
                        UI.logStore.add(log);
                    }
                }
            }
            opener.UI.waitBox.hide();
        });
    }
    function startLog()
    {
        Adl.openLogPipe(opener.getRunOutDir()+'/logfile.tsv',
        function(success)
        {   
            if (success)
            {   
                UI.logDisplayGrid.destroy();
                create();
                getLogMessages();
            }   
            else
            {   
                Ext.MessageBox.alert
                    ("Warning", 
                     "Couldn't open the log file.");
            }   
        });
    }
    Ext.onReady(function() 
    {
        create();
    });
    Any Ideas?
    Doug

  3. #93
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Your store contains local data. That means you have to configure the GridFilters plugin with local:true.

  4. #94
    Sencha User
    Join Date
    Nov 2008
    Posts
    61
    Vote Rating
    0
    SunWuKung is on a distinguished road

      0  

    Default


    Quote Originally Posted by mcouillard View Post
    Actually, setting the grid filter like that results in no action when you hit ENTER on a filter text field. State change events fire, but the store is never loaded with the chosen filter. I'm still working on a solution...
    Thanks for the help ...
    Now that I am doing regexp matching it is even more important for me to be able to do this because with the current setting there is a large number if incorrect requests while the pattern is not yet finished.

  5. #95
    Ext User
    Join Date
    Jun 2008
    Posts
    43
    Vote Rating
    0
    fulfowi is on a distinguished road

      0  

    Default


    Condor,

    That did the trick!
    Doug

  6. #96
    Sencha User KevinChristensen's Avatar
    Join Date
    Sep 2007
    Posts
    36
    Vote Rating
    0
    KevinChristensen is on a distinguished road

      0  

    Default


    Quote Originally Posted by taronja View Post
    no luck abestos girl. I still can't see menu images. But in the css file you've posted there's no style to the < > and = images, that are the ones I can't see.
    The column icon which notice that you have some filter applied is visible to me, also de image for sorting columns.


    !!!!SOLVED!!!!! IT WAS THE CSS ORDER IN MY MAIN FILE. THANK YOU ALL FOR HELPING
    We switched to use the /examples/ux/css/ux-all.css and /examples/ux/ux-all.js and found that the icons for gridfilter are looking in examples/ux/images but none of the images for gridfilter exist there releative to the ux-all.css.
    They are all in examples/ux/gridfilters/images. We copied the images from ux/gridfilters/images to ux/images and now they appear in our web pages. I don't know what to recommend to address this problem but wanted to be sure someone was aware of it.
    -- KC
    "There are only 10 types of people in the world, those who understand binary and those who don't."

  7. #97
    Ext User
    Join Date
    Mar 2010
    Posts
    4
    Vote Rating
    0
    gleskinen is on a distinguished road

      0  

    Default


    I can't even get the filter menu to show. CreateMenu in GridFilters.js completes successfully but the filter menu item or separator are not in the column header menu when it drops down.

  8. #98
    Ext User
    Join Date
    May 2010
    Posts
    1
    Vote Rating
    0
    # eof is on a distinguished road

      0  

    Default problems with certain characters in the text-filter

    problems with certain characters in the text-filter


    Hi,

    At first I would like to thank you for this great Ext-extension.

    I just have one Problem with it. I can't insert certain characters into the text-filter. For example "&", "(" and "'" does not work with the german keyboard-layout. They just don't get inserted. Im shure there will be the same problems with the en-us keyboard layout, perhapst on other keys. It seems that the menu handle these keys as control-element and catch the insert-event.

    You can see this behaviour in the online example: http://ccinct.com/lab/filter-grid/.

    kind regards,

    Arne

  9. #99
    Sencha User
    Join Date
    Aug 2007
    Posts
    52
    Vote Rating
    0
    jamie.nicholson is on a distinguished road

      0  

    Default Stores are destroyed by ListMenu - by default - override to keep some stores

    Stores are destroyed by ListMenu - by default - override to keep some stores


    I have a number of re-usable stores loaded into Ext.StoreMgr and all have a storeId and are used in several places throughout an application. When I destroy the gridfilters it also takes the re-usable stores with it, which causes errors when other parts of the application try to start using the store.

    I've implemented this override to fix the problem, you might consider adding it to the sauce as normally if you create a store without a storeId you won't re-reference it and can destroy/re-create at your pleasure.

    Code:
    Ext.override(Ext.ux.menu.ListMenu,{
        destroy : function () {
            if (this.store.storeId == undefined ) {
                this.store.destroy();
            }
            Ext.ux.menu.ListMenu.superclass.destroy.call(this);
        },
    });

  10. #100
    Ext User
    Join Date
    Apr 2010
    Location
    Orlando, FL
    Posts
    61
    Vote Rating
    0
    george4rotech is on a distinguished road

      0  

    Default clearFilters does not clear filters' input field

    clearFilters does not clear filters' input field


    Thanks for this awesome plugin, it plays nice with other plugins/extensions such as PagingStore and CheckColumn; see http://www.extjs.com/forum/showthrea...722#post471722

    When calling clearFilters however, although the data is reverted, the filter's input field retains the previously entered value. Please see attached screenshots I think they will demonstrate this better than my code could. Nevertheless for the sake of thoroughness below is the entire pertinent method from our code base, though the only pertinent lines are the last two.

    Thanks in advance

    Code:
            this.userAccessLocationGrid.filters.clearFilters();
            this.userAccessLocationGrid.store.loadData(locationsForGrid);
    Attached Images

Thread Participants: 84

  1. VinylFox (1 Post)
  2. galdaka (2 Posts)
  3. Condor (10 Posts)
  4. cgi-bin (4 Posts)
  5. Fabyo (8 Posts)
  6. fshort (1 Post)
  7. digitalkaoz (1 Post)
  8. steffenk (2 Posts)
  9. brookd (1 Post)
  10. jamie.nicholson (1 Post)
  11. sawan (1 Post)
  12. froamer (1 Post)
  13. jaquet (1 Post)
  14. KevinChristensen (1 Post)
  15. bernd01 (2 Posts)
  16. tonedeaf (7 Posts)
  17. seg (1 Post)
  18. calavera (5 Posts)
  19. httpdotcom (1 Post)
  20. Timido (3 Posts)
  21. mfrancey (1 Post)
  22. WixSL (1 Post)
  23. drieraf (1 Post)
  24. nickweavers (2 Posts)
  25. goofy (1 Post)
  26. mynameisyoda (1 Post)
  27. manilodisan (1 Post)
  28. eyetv (1 Post)
  29. renoye (3 Posts)
  30. pouniok (2 Posts)
  31. mcouillard (6 Posts)
  32. Scorpie (1 Post)
  33. wiznia (1 Post)
  34. fulfowi (2 Posts)
  35. benmclendon (1 Post)
  36. roemisch (2 Posts)
  37. zeruyo (1 Post)
  38. dizor (1 Post)
  39. SunWuKung (5 Posts)
  40. mx_starter (1 Post)
  41. jimtyp (2 Posts)
  42. nitingautam (1 Post)
  43. westy (2 Posts)
  44. slemiere (1 Post)
  45. mike2406 (2 Posts)
  46. msinn (12 Posts)
  47. RanmaSaotome (1 Post)
  48. cnicolas (2 Posts)
  49. lsaffre (1 Post)
  50. astraschedule (1 Post)
  51. hankin (2 Posts)
  52. mrinaljena (1 Post)
  53. dtex-lab (1 Post)
  54. yohnan (2 Posts)
  55. Override (2 Posts)
  56. hjones (1 Post)
  57. hexawing (1 Post)
  58. taronja (6 Posts)
  59. asbestos girl (7 Posts)
  60. stalek (1 Post)
  61. mpawlowski (1 Post)
  62. DerSalz (1 Post)
  63. jimm (1 Post)
  64. blueberrymuffins (2 Posts)
  65. gleskinen (1 Post)
  66. pmdarrow (1 Post)
  67. Fallen Zen (1 Post)
  68. filippo.ferrari (6 Posts)
  69. george4rotech (2 Posts)
  70. Ebpo (1 Post)
  71. Reimius (1 Post)
  72. webtime (9 Posts)
  73. Christiand (1 Post)
  74. Oliver Specht (1 Post)
  75. novaku (1 Post)
  76. sizemorew (1 Post)
  77. # eof (1 Post)
  78. ldonofrio (3 Posts)
  79. david777 (1 Post)
  80. ExTriqui (4 Posts)
  81. leowyatt (7 Posts)
  82. JSassy (1 Post)
  83. hachie (1 Post)
  84. radmila80 (1 Post)