PDA

View Full Version : Container form mixing error getID



jop_008
18 Aug 2012, 7:15 AM
I am looking for hours to this problem

In my main controller I have this

var panelbijzonderheden = Ext.create ('Florence.view.saveGebrek'); // returns an object
chtml = Florence.app.complexmapper.summarygebrek (); // returns html
var osummary = Ext.ComponentQuery.query ('#summarygebrek_html')[0]; //returns not an object
alert (osummary); // null
if (osummary) osummary.setHtml ( chtml ); // no sethtml is done
this.getMain().push ( panelbijzonderheden ); this fails with Uncaught TypeError: Object [object Object] has no method 'getId'

I have defined in views/main this

Ext.define ('Florence.view.formsaveGebrek', {
extend:'Ext.form.FormPanel',
id:'formsaveGebrek',
fullscreen: true,
xtype:'formsavegebrek',

items: [
{
xtype: 'textareafield',
name: 'remark',
label: 'Bijzonderheden gebrek'
},
{ xtype: 'spacer' }
,
{
xtype: 'button',
text: 'Save',
pressedCls : 'x-button-pressed',
itemId: 'savebutton',
handler: function () {
Florence.app.complexmapper.insertopnamerecord ();
},
width: '100px',
ui: 'confirm',
scope: this,
} // button
] // items

});

Ext.define ('Florence.view.saveGebrek', {
//extend:'Ext.container',
xtype: 'savegebrek',

config: {
itemId:'savegebrek',
fullscreen: true,
items: [
{
itemId: 'summarygebrek_html',
xtype: 'container',
html:'',
defaults: {
styleHtmlContent: true
}
},
{
xtype: 'formsavegebrek'
}]
}
});

jop_008
19 Aug 2012, 12:44 AM
I didn't have Ext.Container but Ext.container. Layout fullscreen and layout were also not in place.

This was the resulting code:

Ext.define ('Florence.view.formsaveGebrek', {
extend:'Ext.form.FormPanel',

xtype:'formsavegebrek',

config: {
id:'formsaveGebrek',

layout: 'vbox',

items: [
{
xtype: 'textareafield',
name: 'remark',
label: 'Bijzonderheden gebrek',

},
{
xtype: 'button',
text: 'Save',
pressedCls : 'x-button-pressed',
itemId: 'savebutton',
handler: function () {
Florence.app.complexmapper.insertopnamerecord ();
},

width: '40px',
width: '100px',
ui: 'confirm',
scope: this,

} // button
] // items
}
});

Ext.define ('Florence.view.saveGebrek', {
extend:'Ext.Container',
config : {
xtype: 'savegebrek',
id: 'savegebrek',

//fullscreen:true,
layout: 'vbox',
items: [
{
itemId: 'summarygebrek_html',
xtype: 'container',
html:'',
defaults: {
styleHtmlContent: true
},

flex:0.7
},
{
xtype: 'formsavegebrek',
flex:2
}]
}
}); https://mail.google.com/mail/u/0/images/cleardot.gif






John