PDA

View Full Version : [SOLVED] - A different, unexpected error



talha06
8 Jul 2009, 9:33 PM
Hello to everyone,

I'm just starter to Ext and I was trying to make a page with a gridPanel(west layout) & formPanel(center layout). But I got a surprising error from FireBug despite I carefully wrote the code. Can some show my mistake?

Thanx in advance..
Talha

Error: Ext.ViewPort is not a constructor,
fieldLabel: 'T.C. Kimlik No'\r\n
extFirmalar (sat?r 61)



Ext.onReady(function(){
var datalar = new Ext.data.Store({
data: [
[1, 'Firma 1'],
[2, 'Firma 2'],
[3, 'Firma 3'],
[4, 'Firma 4'],
[5, 'Firma 5'],
[6, 'Firma 6']
],
reader: new Ext.data.ArrayReader({id:'id'}, [
'id',
'firmaAdi'
])
});
var viewport = new Ext.ViewPort({
layout: 'border',
renderTo: Ext.getBody(), //document.body,
items: [{
region: 'west',
xtype: 'gridpanel',
store: datalar,
renderTo: document.body,
title: 'Firmalar',
frame: true,
columns: [
{ header: 'ID', dataIndex: 'id', sortable: true, width: 50},
{ header: 'Firma Adi', dataIndex: 'firmaAdi', sortable: true}
],
html: 'West',
split: true,
width: 200
}, {
region: 'center',
html: 'Center',
xtype: 'formpanel',
//renderTo: document.body,
frame: true,
items: [{
xtype: 'textfield',
name: 'adText',
fieldLabel: 'Firma Adi'
}, {
xtype: 'textfield',
name: 'tipText',
fieldLabel: 'Firma Tipi'
}, {
xtype: 'textfield',
name: 'tcText',
fieldLabel: 'T.C. Kimlik No'
}] // Diger subpanel eklenecek
} // Center item sonu
] // viewport->items sonu
}); // viewport'un sonu
}); // Ext.onReady'nin sonu

evant
8 Jul 2009, 9:50 PM
As suggested, it can't find the constructor:



var viewport = new Ext.Viewport

talha06
8 Jul 2009, 10:57 PM
thanx a lot dear friend, but now I still took an error which says: types[config.xtype || defaultType] is not a constructor

types[config.xtype || defaultType] is not a constructor
http://localhost/extFirmalar/lib/extlib/ext-all-debug.js
Line 13521

evant
8 Jul 2009, 11:22 PM
It means it can't find the xtype, yours is wrong.

http://extjs.com/deploy/dev/docs/?class=Ext.grid.GridPanel

Animal
8 Jul 2009, 11:43 PM
thanx a lot dear friend, but now I still took an error which says: types[config.xtype || defaultType] is not a constructor

types[config.xtype || defaultType] is not a constructor
http://localhost/extFirmalar/lib/extlib/ext-all-debug.js
Line 13521


These errors are totally debuggable by yourself.

Break on that error, see what xtype it is attempting to look up.

talha06
9 Jul 2009, 12:04 AM
thanx a lot to all.. :)