1. #1
    Sencha User
    Join Date
    Jul 2008
    Posts
    126
    Vote Rating
    0
    jfizer is on a distinguished road

      0  

    Default "this.proxy is undefined" while attempting to add filtering plugin to grouping grid

    "this.proxy is undefined" while attempting to add filtering plugin to grouping grid


    I have a system that loads javascript arrays to get data into a grouping data grid. So there is no JSON, AJAX, or PhP data srouce. I'm attempting to add the filtering plugin to the grid, however I keep getting the error..

    this.proxy is undefined
    file://localhost/Volumes/Fnord/ext-2.1/ext-all-debug.js
    Line 10614

    I'm at a bit of a loss, anyone out there able to point me in the right direction? Here is the initialization function for the grid, all of which works save the filtering. Data loads, i get the filtering menu option in the columns specified by the "filters" array. However soon as I actually try to filter data, I get the error.

    Code:
    // Grid varriables.
    var flatData = [];
    var dataColumns = [];
    var dataReader = [];
    var srtInfo = {};
    var grpField = '';
    var grpText = '';
    var grdTitle = '';
    var extGrid;
    
    function initGrid(){
        Ext.menu.RangeMenu.prototype.icons = {
          gt: 'img/greater_then.png', 
          lt: 'img/less_then.png',
          eq: 'img/equals.png'
        };
        Ext.grid.filter.StringFilter.prototype.icon = 'img/find.png';
        Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
    
        var filters = new Ext.grid.GridFilters({
        filters:[
            {type: 'string',  dataIndex: 'owner'}
        ]});
    
        Ext.QuickTips.init();
        
        var xg = Ext.grid;
        
        // shared reader
        var reader = new Ext.data.ArrayReader({}, dataReader);
        
        var gridStore = new Ext.data.GroupingStore({
                reader: reader,
                data: flatData,
                sortInfo: srtInfo,
                groupField:grpField
            });
        
        extGrid = new xg.GridPanel({
            store: gridStore,
    
            columns: dataColumns,
    
            view: new Ext.grid.GroupingView({
                forceFit:true,
                startCollapsed:true,
                groupTextTpl: grpText.replace(/&gt;/,">").replace(/&lt;/,"<") 
            }),
    
            frame:true,
            width: 700,
            height: 450,
            collapsible: true,
            animCollapse: false,
            title: grdTitle,
        plugins: filters,
            iconCls: 'icon-grid',
            renderTo: document.body
        });
        extGrid.on('rowdblclick', function(grid, rowIndex, e) {
            window.open(grid.getStore().getAt(rowIndex).get("Link"),"_blank");
        });
    }

  2. #2
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    look at the grouping store source. I think it's a JSON based reader.

  3. #3
    Sencha User
    Join Date
    Jul 2008
    Posts
    126
    Vote Rating
    0
    jfizer is on a distinguished road

      0  

    Default


    Quote Originally Posted by jgarcia@tdg-i.com View Post
    look at the grouping store source. I think it's a JSON based reader.
    That may be, but I don't see how it would help to address the issue I've run into. The grouping store is working just fine, its the filtering thats failing.

  4. #4
    Sencha User
    Join Date
    Jul 2008
    Posts
    126
    Vote Rating
    0
    jfizer is on a distinguished road

      0  

    Default


    So I've done a bit more experimentation. Taking the ouput of the php file in the filtering grid example (http://extjs.com/deploy/dev/examples...rid-filter.php) and plugging in into the javascript for the example as a data property to the json store rather then having the data load from the url results in the same "this.proxy is undefined" error.

    Looking deeper into the example source, it would seem to me that the filtering is actually being done on the server via the php rather then on the client via the extjs grid.

    I had been assuming that client side filtering was an option, it would seem that I'm wrong unless someone can point me in the direction of an example.

  5. #5
    Sencha User
    Join Date
    Jul 2008
    Posts
    126
    Vote Rating
    0
    jfizer is on a distinguished road

      0  

    Default


    Just had to figure out how to tell the filter plugin to use local data.

    Code:
        var filters = new Ext.grid.GridFilters({
        local:true,
        filters:[
            {type: 'string',  dataIndex: 'Owner'}
        ]});
    All better now.

  6. #6
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    You're probably in an excellent position to start a FAQ for that extension.

  7. #7
    Sencha User
    Join Date
    Jul 2008
    Posts
    126
    Vote Rating
    0
    jfizer is on a distinguished road

      0  

    Default


    Quote Originally Posted by mjlecomte View Post
    You're probably in an excellent position to start a FAQ for that extension.
    While an interesting idea, I'm still coming to grips with the extjs system and am in no condition to tell others anything about it.

  8. #8
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    Quote Originally Posted by jfizer View Post
    While an interesting idea, I'm still coming to grips with the extjs system and am in no condition to tell others anything about it.
    I empathize with your statement as I had that at one time too, but I still posted the example and FAQ in my signature below. It's an active board, people will help / correct you.

    P.S. It's the "coming to grips" part that makes you that much more appropriate to document stuff as you have the perspective to do so. After you've learned it then it becomes more challenging to document from the noob mindset. Also take a look at this thread which got doctored up over time.