PDA

View Full Version : headerCtCfg is undefined



rushi2440
23 Mar 2012, 2:13 AM
Hi
I am using Desktop view. and I am creating Grid panel in extjs mvc structure.
when I am clicking on desktop icon at that time i am getting headerCtCfg is undefined.
my controller is


Ext.define('gantt.controller.AlbumsController', {
extend: 'Ext.app.Controller',
stores: ['Albums'],
models: ['Album'],
views: ['List'],
init: function() {
console.log("Init");
}
});

main window view code is

Ext.define('gantt.view.MainWindow', {
extend: 'gantt.model.Module',
alias: 'widget.mainWindow',
id: 'mainWindow',
requires: ['gantt.view.List'],
init: function() {
this.launcher = {
text: 'Album Management Window',
handler: this.createWindow,
scope: this
};
},
createWindow: function() {
var desktop = this.app.getDesktop();
var win = desktop.getWindow('gridView');
if (!win) {
win = desktop.createWindow({
id: 'gridView',
title: 'Album Management',
width: '99.5%',
height: '95%',
animCollapse: false,
constrain: true,
layout: 'border',
draggable: true,
closeAction: 'destroy',
items: [{
region: 'center',
collapsible: true,
xtype: 'gridtest'
}]
});
}
win.show();
return win.setPosition(100, 100);
}
});

my gridpanel view code is

Ext.define('gantt.view.List', {
extend: 'Ext.grid.Panel',
alias: 'widget.gridtest',
store: 'Albums',
id: 'gridtest',
initComponent: function() {
console.log("Init component");
this.callParent(arguments);
}
});

my model is


Ext.define('gantt.model.Album', {
extend: 'Ext.data.Model',
fields: [
{
name: 'id',
dataType: 'int',
optional: true
},
{
name: 'name',
dataType: 'string',
optional: true
},
{
name: 'artist',
dataType: 'string'
}
],
idProperty: 'id',
proxy: {
type: 'ajax',
api: {
read: 'Album/Get',
create: 'Album/Create',
destroy: 'Album/Delete',
update: 'Album/Update'
},
reader: {
type: 'json',
root: 'data'
},
writer: {
root: 'data',
type: 'json',
encode: true,
writeAllFields: true
}
}
});

my store is


Ext.define('gantt.store.Albums', {
extend: 'Ext.data.Store',
autoLoad: true,
autoSync: true,
model: 'gantt.model.Album'
});

RPKintu
Sr. Programmer
Kintudesigns.com

mitchellsimoens
23 Mar 2012, 11:30 AM
Have you tried giving the grid some columns?

rushi2440
25 Mar 2012, 10:34 PM
Hi

got the solution..
I forgot to add columns to grid panel view.

RPKintu
Sr. Programmer
Kintudesigns.com