PDA

View Full Version : instance Window Correctly But Cannot Show From App Controller



whnois
22 Mar 2012, 9:22 PM
hello

i am trying to create a window and show it. but it doesn't display any way. i try to create by directley and by view. same result on show method call


Ext.create (http://docs.sencha.com/ext-js/4-0/#!/api/Ext-method-create)('Ext.window.Window (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.window.Window)',{

title:'Hello', height:200, width:400, layout:'fit'}).show();


Uncaught TypeError: Cannot call method 'getById' of undefined

vietits
22 Mar 2012, 10:29 PM
The following code works well for me. I am using Ext 4.0.7 and Chrome.


Ext.require([
'Ext.window.Window'
]);
Ext.onReady(function() {


Ext.create('Ext.window.Window',{
title:'Hello',
height:200,
width:400,
layout:'fit'
}).show();


});

whnois
24 Mar 2012, 12:46 AM
i copy and edit Pandora web application for my job. Before file uploader widget doesn't work. now window. is there wrong way my app? here is my method for adding component to viewport center container



onPageSelect: function(rowModel, record, index, eOpts ) {

var me = this;


var main = this.getMainArea();


var pageId = record.get('id');

var itemId = 'page' + pageId;


if (main.down('#'+itemId) == null) {


var page = Ext.create('Pandora.view.Page', {
itemId : itemId,
pageId : pageId
});


main.add(page);

me.loadPage('tr', pageId, page.down('#tr'));
}

this.setPageId(pageId);


main.getLayout().setActiveItem(itemId);
},


i use ext-all-debug. so no need require definition, i think (Ext.loader is too slow. maybe there is another way for the method, generate dynamic compress etc)

conclusion: ExtJS2.2.2 more stable than ExtJS4