PDA

View Full Version : basic problem with pre-configured class



nibblas
14 Oct 2010, 12:25 AM
hello @ all.
i'm pretty new on ext js and have a question about pre-configured classes depending on the tutorial writing a big application

here's my code (KundenGrid.js)

Ext.namespace('CRM.panels');



// Extend the Ext.grid component
CRM.panels.KundenGrid = Ext.extend(Ext.grid.GridPanel,{
// constructor properties
initComponent:function() {
Ext.apply(this,{
applyTo :'my_id',
title :'KundenGrid',
height :200,
width :500,
store :store,
columns : [
{header: "id", dataIndex: 'id'},
{header: "title", dataIndex: 'title'},
{header: "director", dataIndex: 'director'}
]
});
CRM.panels.KundenGrid.superclass.initComponent.apply(this,arguments);
}
,onRender:function(){
this.store.load();
CRM.panels.KundenGrid.superclass.onRender.apply(this,arguments);
}

});
Ext.reg('KundenGrid',CRM.panels.KundenGrid);

application.js i made an instance of this


Ext.onReady(function(){

var w = new Ext.Window({
layout: 'form',
items:[
{ xtype: 'KundenGrid'},
new Ext.form.TextField({fieldLabel: 'Surname'})
]
});
w.show();
});

i just don't get wha'ts wrong, i'm overiding superclass onrender and init but it won't work... any idea?
js files are correctly include in the .html file....

thx & greetings train

Animal
14 Oct 2010, 12:47 AM
"won't work" doesn't really help us to help you!

Is the store being loaded? Look at it in Firebug.