PDA

View Full Version : Extjs 3 to 4 migration



raiwinashu
17 May 2012, 9:57 PM
Hi,
I'm trying upgrade my application from ext3 to 4.as i'm new to this i'm finding it difficult to fix breaking changes.can some one help me with the following code,

Firebug error console is showing Resultgrid is undefined error





m = new MainPanel(); var Resultgrid = m.FeedGrid;
Resultgrid.id = 'search_result'; Resultgrid.collapsible = true;

MainPanel = function(source) {----
this.grid = new FeedGrid(this,
{
tbar: [{......}],--
});
//Definition for feedgrid
FeedGrid = function(viewer, config)
{
this.viewer = viewer;
Ext.apply(this, config);
this.store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'ExtJsHandler.ashx'
}),
remoteSort: true,
reader: new Ext.data.JsonReader(
{
root: 'documents',
totalProperty: 'totalCount',
id: 'documentReviewId'
},
[
{ name: 'documentReviewId' },{},{}] ]
)
});
this.bbar = new Ext.PagingToolbar({....});
this.columns = [{},{}];
FeedGrid.superclass.constructor.call(this, {...});

};

Ext.define('FeedGrid', {
extend:'Ext.grid.Panel',
onContextClick : function(grid, index, e){... },
onContextHide : function(){.... },
loadFeed : function(dept, page) {
Ext.getCmp('mnuPublished').setChecked(false);

this.store.baseParams = {
feed: dept
};

this.store.load({params:{start: start, limit: limit}});
},....});






Thanks!
Ashwin

jay@moduscreate.com
20 May 2012, 4:14 AM
Ashwin, your Define pattern is not good. Look at how classes are defined in Ext JS 4, and you'll not find that the constructor is defined OUTSIDE of the define call :)