i'm really new to extjs 4. im try to load default value form load as bellow
launch: function() {
Ext.create('panelid', {renderTo: 'form'});
var form = this.up('panelid').getForm();
var model = Ext.getCmp('modelid');
form.loadRecord(model);
}
that not work form me that gave to me undefined form
this my view class
Ext.define('panelid', {
extend: 'Ext.form.Panel',
alternateClassName: [
'confpanel'
],
requires: [
'Ext.container.Container',
'Ext.form.field.File',
'Ext.button.Button'
],
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'textfield',
itemId: 'NAME_2',
fieldLabel: 'SDFA',
name: 'NAME_2'
},
{
xtype: 'button',
handler: function(button, e) {
var form = this.up('form').getForm();
if(form.isValid()){
form.submit({
url: 'AA?submit=true'
});
}
},
itemId: 'btnSave',
text: 'Save'
}
]
});
me.callParent(arguments);
}
});
my store userClassName name is 'storeid' and my model userClassName is modelid
this very simple question but it really hard to understand data communication in between server-client. please help to me this simple question
initComponent
. You don't gain anything by it. As far as your error is concerned, I think you need to set analias
to your view. The commandup('panelid')
doesn't know whatpanelid
is. Add the following:..., alias: 'widget.panelid'
after theextend
. – adaskos