PDA

View Full Version : HELP! Keep getting error with 1 window and 2 panels



hananyariv
15 Feb 2011, 4:01 AM
Hello All,
i am new to EXTjs so i am sure i am missing something, i have searched for days now but i haven't found my solution..
I am tring to create a window that is basicly a form with 2 textfields 2 combo boxes and 2 Gridpanels..
i have started building my gridpanels and tried just testing to see how they look in my window, but no metter what i tried FireBud keep giving my errors
"A is undefined
[Break On This Error] Ext.Container=Ext.extend(Ext.BoxCompon...};Ext.reg("container",Ext.Container); "

Can someone please take a look and telling me what i am doing wrong :s

Code :


// Global vars
var StockDataStore;
var SaleDataStore;
var StockColumnModel;
var SaleColumnModel;
var StockListingGrid;
var SaleListingGrid;
var MRKZListingWindow;







Ext.onReady(function(){

Ext.QuickTips.init();

// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< SALES GRID SETTINGS START >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< SALES GRID SETTINGS START >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< SALES GRID SETTINGS START >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

// <<<<<<<<<<<<<<<<<<<<<<<<< Start DataStore Settings >>>>>>>>>>>>>>>>>>>>>>>>>>>>

var FloatingSale = Ext.data.Record.create([
{ IMEI: 'IMEI'},
{ p_item: 'item'},
{ Price: 'Price'},
{ DateCame: 'DateCame'},


]);

var FloatingSaleProxy = new Ext.data.MemoryProxy({
root: [{
IMEI: 'Homer',
p_item: 'Simpson',
Price : 'Homer',
DateCame: 'Homer'
}]
});

SaleDataStore = new Ext.data.Store({
reader: new Ext.data.JsonReader({
root: "root"
}, FloatingSale),
proxy: FloatingSaleProxy
});
FloatingSale.load();

// <<<<<<<<<<<<<<<<<<<<<<<<< End DataStore Settings >>>>>>>>>>>>>>>>>>>>>>>>>>>>


// <<<<<<<<<<<<<<<<<<<<<<<<< Start Column Settings >>>>>>>>>>>>>>>>>>>>>>>>>>>>

SaleColumnModel = new Ext.grid.ColumnModel([
{
dataIndex: 'string',
header: 'Item',
sortable: true,
width: 100,
editable: false,
hideable: false,
tooltip: 'This is the type of item'
}

,
{
dataIndex: 'number',
header: 'Price Per 1 Item',
sortable: true,
width: 100,
align: 'right'
}

,

{
dataIndex: 'number',
header: 'Number in Stock',
sortable: true,
width: 100,
align: 'right'
}
]);

StockColumnModel.defaultSortable= true;
// <<<<<<<<<<<<<<<<<<<<<<<<< End Column Settings >>>>>>>>>>>>>>>>>>>>>>>>>>>>

SaleListingGrid = new Ext.grid.EditorGridPanel({ // Grid Settings
// frame : true,
id: 'SaleListingGrid',
store: SaleDataStore,
cm: SaleColumnModel,
enableColLock:false,
clicksToEdit:2,
forceFit : true,
collapsible: true,
region : 'north',
selModel: new Ext.grid.RowSelectionModel({singleSelect:false}),

});

// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< SALES GRID SETTINGS END >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< SALES GRID SETTINGS END >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< SALES GRID SETTINGS END >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< STOCK GRID SETTINGS START >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< STOCK GRID SETTINGS START >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< STOCK GRID SETTINGS START >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

// <<<<<<<<<<<<<<<<<<<<<<<<< Start DataStore Settings >>>>>>>>>>>>>>>>>>>>>>>>>>>>
StockDataStore = new Ext.data.Store({
id: 'StockDataStore',
proxy: new Ext.data.HttpProxy({
waitMsg: 'Please Wait',
url: 'database.php',
method: 'POST'
}),
baseParams:{task: "GiveStock"},
reader: new Ext.data.JsonReader({
root: 'results',
totalProperty: 'total',
id: 'id'
},

[

{name: 'p_Item', type: 'string', mapping: 'Item'},

{name: 'Price', type: 'int', mapping: 'Price'},

{name: 'Amount', type: 'int', mapping: 'Amount'},


]), // sortInfo:{field: 'AI', direction: "DESC"}
});

// <<<<<<<<<<<<<<<<<<<<<<<<< End DataStore Settings >>>>>>>>>>>>>>>>>>>>>>>>>>>>


// <<<<<<<<<<<<<<<<<<<<<<<<< Start Column Settings >>>>>>>>>>>>>>>>>>>>>>>>>>>>

StockColumnModel = new Ext.grid.ColumnModel([
{
dataIndex: 'string',
header: 'Item',
sortable: true,
width: 100,
editable: false,
hideable: false,
tooltip: 'This is the type of item'
}

,
{
dataIndex: 'number',
header: 'Price Per 1 Item',
sortable: true,
width: 100,
align: 'right'
}

,

{
dataIndex: 'number',
header: 'Number in Stock',
sortable: true,
width: 100,
align: 'right'
}
]);

StockColumnModel.defaultSortable= true;
// <<<<<<<<<<<<<<<<<<<<<<<<< End Column Settings >>>>>>>>>>>>>>>>>>>>>>>>>>>>

StockListingGrid = new Ext.grid.EditorGridPanel({ // Grid Settings
// frame : true,
id: 'StockListingGrid',
store: StockDataStore,
cm: StockColumnModel,
enableColLock:false,
clicksToEdit:2,
forceFit : true,
collapsible: true,
region : 'center',
selModel: new Ext.grid.RowSelectionModel({singleSelect:false}),

});

// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< STOCK GRID SETTINGS End >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< STOCK GRID SETTINGS End >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< STOCK GRID SETTINGS End >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


MRKZListingWindow = new Ext.Window({
id: 'MRKZListingWindow',
title: 'MRKZ main listing ... ',
closable:true,
maximizable:true,
width:700,
height:350,
// border : true,
// plain:true,
layout : 'border',
items:[StockListingGrid,SaleListingGrid]
});




StockDataStore.load({params: {start: 0, limit: 50}});
SaleDataStore.load({params: {start: 0, limit: 50}});
MRKZListingWindow.show();




});

woozy
15 Feb 2011, 6:03 AM
I think you have to put your stuff inside a panel, not directly in the window.

Try to replace your window items with:


items:[{xtype:'panel', items:[StockListingGrid,SaleListingGrid]}]