1. #1
    Ext User
    Join Date
    Aug 2010
    Posts
    1
    Vote Rating
    0
    zerovian is on a distinguished road

      0  

    Default exception reconfiguring gridpanel using a grouping view

    exception reconfiguring gridpanel using a grouping view


    Ext JS Version 3.2.1

    I have a gridpanel on another panel for which I periodically need to reconfigure with a new store and a new column model. If this gridpanel is configured with a grouping view then when the load of the store is finished, i get an exception in the 'refresh' method of the gridpanel. If I remove the grouping view from the grid, then I can safely reconfigure the grid without exceptions.

    Here is the exception as reported from Chrome (firefox, ie, safari, chrome all report it):

    ext-all-debug.js:44568 Uncaught TypeError: Cannot call method 'stopEditing' of undefined

    This isn't the exact code, but its close.

    Code:
    			
    
    var url = "...";
    
    var userProxy = new Ext.data.HttpProxy( {
    	url : url,
    	restful : true
    });
    
    var reader = new Ext.data.JsonReader( {
    	root : 'users',
    	fields : [ 'name', 'id']
    });
    
    var store = new Ext.data.GroupingStore( {
    	reader : reader,
    	autoSave : false,
    	proxy : userProxy
    });
    
    var cm = new Ext.grid.ColumnModel( {
    	defaults : {
    		width : 120,
    		sortable : true
    	},
    	columns : [ {
    		header : "User Id",
    		dataIndex : 'id'
    	}, {
    		header : 'User Name',
    		dataIndex : 'name'
    	} ]
    });
    
    
    var grid = new Ext.grid.GridPanel( {
    	forceLayout : true,
    	itemId : 'grid',
    	height : 200,
    	store : store,
    	colModel : cm,
    	sm : new Ext.grid.RowSelectionModel( {
    		singleSelect : true
    	}),
    	viewConfig : {
    		forceFit : true
    	},
    	view : new Ext.grid.GroupingView( {
    		forceFit : true,
    		groupTextTpl : '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Users" : "User"]})'
    	})
    });
    
    
    // some time later this gets called
    ...
    var oldStore = grid.getStore();
    var store = this.createStore();
    var cm = this.createColumnModel();
    grid.reconfigure(store, cm);
    store.load();
    if (oldStore) {
      oldStore.deestroy();
    }

    The appropaite code from ext-all-debug.js is here:


    Code:
       
     refresh : function(headersToo){
            this.fireEvent('beforerefresh', this);
            this.grid.stopEditing(true);   // it blows up on this line because this.grid is undefined
    
            var result = this.renderBody();
            this.mainBody.update(result).setWidth(this.getTotalWidth());
            if(headersToo === true){
                this.updateHeaders();
                this.updateHeaderSortState();
            }
            this.processRows(0, true);
            this.layout();
            this.applyEmptyText();
            this.fireEvent('refresh', this);
        },

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    "some time later this gets called"... When exactly? Has the grid already been rendered?

  3. #3
    Sencha User
    Join Date
    Jun 2012
    Posts
    4
    Vote Rating
    0
    jleblanc is on a distinguished road

      0  

    Default


    I know this is an old thread, but I've just encountered the same problem. Is this a bug in ExtJS?

Similar Threads

  1. Grid buffered view and grouping view ?
    By lucky56100 in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 19 Jul 2010, 1:14 AM
  2. Null view when reconfiguring a GridPanel
    By cassio_bastos in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 14 May 2009, 5:51 AM
  3. Exception with Grouping Grid, JSON
    By mrapczynski in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 6 Nov 2007, 8:53 AM
  4. Grouping Grid Exception with metaData
    By debutant in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 19 Oct 2007, 1:25 PM

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar