markInvalid is not marking field with red zigzag - extjs

My issue is that in change event of FTPSettingHost, markInvalid is not marking the field invalid : what I mean by invalid, the field is highlighted with red zigzag.
I'm getting empty fields each time the field is change(change event) and mark them invalid.
Is it possible to make a validator for that? and how? When a validator is called?
Here is the panel :
Ext.define("Backend.project.FtpPanel", {
xtype : "ftpPanel",
extend : "Ext.form.Panel",
border : 0,
id : 'ftpForm',
layout : 'anchor',
defaults : {
labelStyle : "font-weight: font-size: 11px",
fieldStyle : "font-size: 12px;",
anchor : "100%",
labelWidth : 180
},
initComponent : function () {
var me = this;
var ftpFields = [{
id : 'FTPSettingsHost',
label : LocalizationUtils.getMessage("FTPHost")
}, {
id : 'FTPSettingsPath',
label : LocalizationUtils.getMessage("FTPPath")
}, {
id : 'FTPSettingsUsername',
label : LocalizationUtils.getMessage("FTPUsername")
}, {
id : 'FTPSettingsPassword',
label : LocalizationUtils.getMessage("FTPPassword")
}
];
this.FTPSettingsHost = new Ext.form.field.Text({
fieldLabel : LocalizationUtils.getMessage("FTPHost"),
anchor : "100%",
id : "FTPSettingsHost",
name : "FTPSettingsHost",
xtype : 'textfield',
allowOnlyWhitespace : false,
//validator : FormUtils.getAllFieldsNonEmptyValidator("FTPSettingsPath", ftpFields)
listeners : {
change : {
fn : function (cmp) {
// Get empty fields
var fields = FormUtils.getEmptyFields(me);
var labels = [];
for (var i = 0; i < fields.length; i++) {
//console.log(fields[i]);
labels[i] = fields[i].getFieldLabel();
}
var message = LocalizationUtils.getMessage("AllTheseFieldsRequired", [labels.join(", ")]);
for (var i = 0; i < fields.length; i++) {
fields[i].clearInvalid();
fields[i].markInvalid(message);
}
}
}
}
});
this.FTPSettingsPath = new Ext.form.field.Text({
fieldLabel : LocalizationUtils.getMessage("FTPPath"),
anchor : "100%",
id : "FTPSettingsPath",
name : "FTPSettingsPath",
xtype : 'textfield',
allowOnlyWhitespace : false,
});
this.FTPSettingsUsername = new Ext.form.field.Text({
fieldLabel : LocalizationUtils.getMessage("FTPUsername"),
anchor : "100%",
id : "FTPSettingsUsername",
name : "FTPSettingsUsername",
xtype : 'textfield',
allowOnlyWhitespace : false,
});
this.FTPSettingsPassword = new Ext.form.field.Text({
fieldLabel : LocalizationUtils.getMessage("FTPPassword"),
anchor : "100%",
id : "FTPSettingsPassword",
name : "FTPSettingsPassword",
xtype : 'textfield',
allowOnlyWhitespace : false,
});
Ext.apply(this, {
items : [me.FTPSettingsHost, me.FTPSettingsPath, me.FTPSettingsUsername, me.FTPSettingsPassword]
});
this.callParent(this);
}
})
Thank you all for the help !

I looked through your fiddle and here is my version: http://jsfiddle.net/Jandalf/UehL7/22/
Ext.define("Backend.project.FtpPanel", {
xtype: "ftpPanel",
extend: "Ext.form.Panel",
border: 1,
id: 'ftpForm',
height: 200,
width: 500,
renderTo: Ext.getBody(),
layout: 'anchor',
bodyPadding: 10,
fieldDefaults: {
allowBlank: false,
labelStyle: "font-weight: bold; font-size: 11px",
fieldStyle: "font-size: 12px;",
anchor: "100%",
labelWidth: 180
},
items: [{
fieldLabel: "FTPHost",
id: "FTPSettingsHost",
name: "FTPSettingsHost",
xtype: 'textfield'
},{
fieldLabel: "FTPPath",
id: "FTPSettingsPath",
name: "FTPSettingsPath",
xtype: 'textfield'
},{
fieldLabel: "FTPUsername",
id: "FTPSettingsUsername",
name: "FTPSettingsUsername",
xtype: 'textfield'
},{
fieldLabel: "FTPPassword",
id: "FTPSettingsPassword",
name: "FTPSettingsPassword",
xtype: 'textfield'
}]
});
Is this what you want or do you really need to mark all fields invalid at once?

Related

ExtJS 4 Render Errors On Viewport in a New Tab

I am developing an extjs and spring application. I got stuck in rendering view in new tab in center region of viewport. I have not able to create an instance of the view using ref in controller. please help and let me know where i am doing wrong..
Controller js
Ext.define('Book.controller.NewBook', {
extend : 'Ext.app.Controller',
views : ['book.NewBook'],
refs : [ {
ref : 'bookViewport',
selector : 'viewport' //whatever the xtype is of your viewport class
}, { ref : 'newBookForm',
selector : '#newBook panel',
autoCreate: true//whatever the xtype is of your viewport class
} ],
init : function() {
// add the components and events we listen to
this.control({
'viewport > panel' : {
render : this.onPanelRendered
},
'viewport' : {
afterrender : this.onNewBookLinkClick
}
});
},
onNewBookLinkClick : function() {
var view = this.getBookViewport();
var newBook = this.getNewBookForm();
alert(newBook.id);
Ext.get('tab1').on('click', function() {
var tabExists = false;
var p1=Ext.getCmp('panel').getLayout();
var p2=Ext.getCmp('panel');
var items = p2.items;
for (var i = 0; i < items.length; i++) {
alert(items[i].id);
if (items[i].id === 'NewBook') {
this.getViewport().panel.setActiveTab(i);
tabExists = true;
this.getViewport().panel.setActiveTab(i);
}
}
if (!tabExists) {
p2.insert(1, newBook);
p2.setActiveTab(0);
}
});
},
onPanelRendered : function() {
}
});
View
Ext.define('Book.view.book.NewBook', {
extend : 'Ext.form.Panel',
alias : 'widget.newBook',
config: {},
constructor: function (config) {
this.initConfig(config);
return this.callParent(arguments);
},
initComponent: function () {
Ext.apply(this, {
layout : 'vbox',
contentEl : 'center2',
title : 'New Book',
store : 'Books',
id : 'NewBook',
defaults : {
bodyPadding : 10
},
items : [ {
xtype : 'panel',
width : 900,
collapsible : true,
title : 'Book Details',
defaults : {
width : 230,
cls : 'form-field'
},
defaultType : 'textfield',
items : [ {
fieldLabel : 'Book Id',
name : 'bookId',
value : '',
// validator : function(event) {
// if (!(/[0-9]/.test(this.getValue()))) {
// return "This Field should be in Numbers only";
// }
// return true;
// }
} ]
}]
});
this.callParent(arguments);
}
});
ViewPort
Ext.define('Book.view.Viewport', {
extend: 'Ext.container.Viewport',
alias : 'widget.viewport',
requires: [
'Book.view.book.catCombo',
'Book.view.book.subCatCombo',
'Book.view.book.NewBook',
'Book.view.book.BookGrid',
'Book.view.book.SearchBook',
'Book.view.book.ModifyBook'
],
id : 'borderViewPort',
layout : 'border',
items : [
Ext.create('Ext.Component', {
region : 'north',
height : 0
}),
{
region : 'west',
stateId : 'navigation-panel',
id : 'west-panel',
title : 'Navigation Menu',
split : true,
width : 200,
minWidth : 175,
maxWidth : 400,
collapsible : true,
animCollapse : true,
margins : '0 0 0 5',
layout : 'accordion',
items : [ {
contentEl : 'west',
title : '<b>Books</b>',
html : '<div id="west" class="x-hide-display"><ul> <li>New Book</li> <li>Search Book</li> </ul></div>',
iconCls : 'nav'
}, {
title : 'Purchase Order',
iconCls : 'settings'
}, {
title : 'Total Sales',
iconCls : 'info'
} ]
},
panel = Ext.create('Ext.tab.Panel', {
region : 'center',
id : 'panel',
deferredRender : false,
activeTab : 0
}) ]
});
app.js
Ext.application({
name: 'Book',
models: ['Book'],
stores: ['Books','BookCategories','BookSubCategories'],
controllers: ['NewBook', 'SearchBook'],
autoCreateViewport: true,
launch: function() {
Ext.create('Book.view.Viewport');
}
}
);
Your center region config is incorrect since you have defined it as panel variable, but not actually made it a child of the viewport items.
Instead, use this approach:
new Ext.Viewport({
layout: 'border',
items: [{
region: 'north',
html: '<h1 class="x-panel-header">Page Title</h1>',
autoHeight: true,
border: false,
margins: '0 0 5 0'
},{
region: 'west',
stateId : 'navigation-panel',
id : 'west-panel',
title : 'Navigation Menu',
split : true,
width : 200,
minWidth : 175,
maxWidth : 400,
collapsible : true,
animCollapse : true,
margins : '0 0 0 5',
layout : 'accordion',
items : [ {
contentEl : 'west',
title : '<b>Books</b>',
html : '<div id="west" class="x-hide-display"><ul> <li>New Book</li> <li>Search Book</li> </ul></div>',
iconCls : 'nav'
}, {
title : 'Purchase Order',
iconCls : 'settings'
}, {
title : 'Total Sales',
iconCls : 'info'
}]
// the west region might typically utilize a TreePanel or a Panel with Accordion layout
},{
region: 'center',
xtype: 'tabpanel', // TabPanel itself has no title
items: [{
title: 'Tab 1'
},{
title: 'Tab 2'
}]
}]
});
This displays correctly, you should see how you can adapt this to your view definition.
The problem is solved by removing contentEl : 'center2', tag from my NewBook view.
contentEl uses the target element as its body content (the panel could still be rendered to any other element)

"Ext.getCmp(...) is undefined" in different function

I have Extjs code in view, this is it:
createPanelMC: function() {
this.requiredSign = '<span style="color:red;font-weight:bold" data-qtip="Required">*</span>';
var panel = Ext.create('Ext.form.Panel', {
defaultType: 'textfield',
name: 'nodebPanel',
width: '100%',
layout: {
type: 'auto',
align: 'stretch'
},
items: [{
xtype : 'fieldset',
name : 'modlayanan',
title : 'Data Pelanggan',
layout : 'column',
width : '95%',
margin : '10',
items: [{
xtype : 'textfield',
name : 'nomor',
id : 'nomor',
fieldLabel : 'PSTN',
emptyText : 'Nomor...',
margin : '10 0 0 0',
width : 350,
labelWidth : 100,
afterLabelTextTpl: this.requiredSign
}, {
xtype : 'textfield',
fieldLabel : 'Speedy',
name : 'speedy',
id : 'speedy',
margin : '10 0 10 20',
width : 350,
labelWidth : 100
},
this.createTreePaketExist()
]
}],
dockedItems: [ {
xtype: 'toolbar',
name: 'tbpaketmc',
dock: 'bottom',
items: [ {
text: '<< Back',
action: 'doBack'
},'->', {
text: 'Submit',
action: 'doSubmit'
}
]
}
]
});
return panel;
},
i call nomor dan speedy in this.createTreePaketExist() . This is the this.createTreePaketExist() code:
createTreePaketExist: function() {
var nopstn= Ext.getCmp('nomor').getValue();
var speedy= Ext.getCmp('speedy').getValue();
var storeTree = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
method: 'POST',
url: 'data/newoss_get_paket.php',
params: {
nopstn:nopstn
,speedy:speedy
}
}
});
var groupProduct = Ext.create('Ext.tree.Panel', {
store : storeTree,
name : 'treeProduct',
rootVisible : false,
useArrows : true,
layout :'fit',
margin : '0 0 0 0',
autoScroll : true,
height : 150,
width : '93%',
listeners:
{
checkchange: function(node, checked, eOpts){
node.eachChild(function(n) {
node.cascadeBy(function(n){
n.set('checked', checked);
});
});
p = node.parentNode;
var pChildCheckedCount = 0;
p.suspendEvents();
p.eachChild(function(c) {
if (c.get('checked')) pChildCheckedCount++;
p.set('checked', !!pChildCheckedCount);
});
p.resumeEvents();
}
}
});
return groupProduct;
},
but it gave an error: Ext.getCmp(...) is undefined. Help me, thanks.
Ext.getCmp() is not recommended to use in ExtJS code. Instead you should use
Ext.ComponentQuery.query('#nomor')
Where nomor is id of element.
But To resolve your problem try to call this:
Ext.ComponentQuery.query('textfield[name="nomor"]')
or
Ext.getCmp('#nomor')
if this will not help you then the problem in your code structure. May be piece of code that represents getCmp('nomor') is loaded and invoked before piece of code that represents your nomor code. This problem may occur if you do not use MVC
The createTreePaketExist will be called during component initialisation, it's unlikely the textfields are actually rendered or even initialised properly at this point, best to use the listeners. You could use refs in your controller to get a reference to these fields automatically or you could listen to the afterrender event and then reference the fields.
I have created a fiddle here that shows how to load the store on form submit, you could also do this on the textfield's change events.
Here is the code for reference:
Ext.application({
name: 'Fiddle',
launch: function() {
var panel = Ext.create('Ext.form.Panel', {
renderTo: Ext.getBody(),
defaultType: 'textfield',
name: 'nodebPanel',
width: '100%',
layout: {
type: 'auto',
align: 'stretch'
},
items: [{
xtype: 'fieldset',
name: 'modlayanan',
title: 'Data Pelanggan',
layout: 'column',
width: '95%',
margin: '10',
items: [{
xtype: 'textfield',
name: 'nomor',
id: 'nomor',
fieldLabel: 'PSTN',
emptyText: 'Nomor...',
margin: '10 0 0 0',
width: 350,
labelWidth: 100,
afterLabelTextTpl: this.requiredSign
}, {
xtype: 'textfield',
fieldLabel: 'Speedy',
name: 'speedy',
id: 'speedy',
margin: '10 0 10 20',
width: 350,
labelWidth: 100
}]
}],
dockedItems: [{
xtype: 'toolbar',
name: 'tbpaketmc',
dock: 'bottom',
items: [{
text: '<< Back',
action: 'doBack'
}, '->', {
text: 'Submit',
action: 'doSubmit',
bindForm: true,
handler: function() {
var nopstn = Ext.getCmp('nomor').getValue();
var speedy = Ext.getCmp('speedy').getValue();
if (nopstn != '' && speedy != '') {
var store = Ext.ComponentQuery.query('#treeProduct')[0].getStore();
console.log(store);
store.load({
params: {
nopstn: nopstn,
speedy: speedy
}
});
}
}
}]
}]
});
var storeTree = Ext.create('Ext.data.TreeStore', {
autoLoad: false,
proxy: {
type: 'ajax',
method: 'POST',
url: 'data/newoss_get_paket.php'
}
});
var groupProduct = Ext.create('Ext.tree.Panel', {
renderTo: Ext.getBody(),
store: storeTree,
itemId: 'treeProduct',
name: 'treeProduct',
rootVisible: false,
useArrows: true,
layout: 'fit',
margin: '0 0 0 0',
autoScroll: true,
height: 150,
width: '93%',
listeners: {
checkchange: function(node, checked, eOpts) {
node.eachChild(function(n) {
node.cascadeBy(function(n) {
n.set('checked', checked);
});
});
p = node.parentNode;
var pChildCheckedCount = 0;
p.suspendEvents();
p.eachChild(function(c) {
if (c.get('checked')) pChildCheckedCount++;
p.set('checked', !! pChildCheckedCount);
});
p.resumeEvents();
}
}
});
}
});

ExtJs vtype compare using VTypes with multiple combo boxes

Have a form where I have two group boxes with two combo boxes each. The first group box is for a deposit payment and the second is for the final payment. The first combo box in each group box is to make the payment a request and the second is to make the payment mandatory. But you cannot make the deposit payment and required payments both set to mandatory.
Therefore, I have been trying to use VTypes to check and compare the two required combo boxes and put out a message if they are both set to YES. I'm unable to get the contents of the other combo box using field,up('form').down('#' + field.pmtField); (where pmtField is defined in the item.)
Here is the code:
(Ext.myapplication extends Ext.grid.Panel)
var form=new Ext.myapplication(
{
layout : {type: 'vbox', align: 'stretch'},
border : false,
items:
[
{
xtype: 'fieldset',
title: 'Deposit Requirements',
items:
[
{
xtype : 'fieldcontainer',
layout:{type: 'hbox'},
border: 0,
items:
[
{
xtype : 'combobox',
name : 'deposit_request_flag',
labelAlign : 'top',
inputWidth : 30,
fieldLabel : 'Requested',
labelStyle : 'font-weight:bold',
valueField : 'deposit_request_flag',
editable : false,
value : 'f',
store : [['t','YES'],['f','NO']]
},
{
xtype : 'combobox',
name : 'deposit_required_flag',
labelAlign : 'top',
inputWidth : 30,
fieldLabel : 'Required',
labelStyle : 'font-weight:bold',
valueField : 'deposit_required_flag',
editable : false,
vtype : 'depositFlagCheck',
pmtField : 'payment_required_flag',
value : 'f',
store : [['t','YES'],['f','NO']]
}
]
}
]
},
{
xtype: 'fieldset',
title: 'Payment Requirements',
items:
[
{
xtype : 'fieldcontainer',
layout:{type: 'hbox'},
border: 0,
items:
[
{
xtype : 'combobox',
name : 'payment_request_flag',
labelAlign : 'top',
fieldLabel : 'Requested',
labelStyle : 'font-weight:bold',
valueField : 'payment_request_flag',
editable : false,
value : 'f',
store : [['t','YES'],['f','NO']]
},
{
xtype : 'combobox',
name : 'payment_required_flag',
labelAlign : 'top',
fieldLabel : 'Required',
labelStyle : 'font-weight:bold',
valueField : 'payment_required_flag',
vtype : 'paymentFlagCheck',
depField : 'deposit_required_flag',
editable : false,
value : 'f',
store : [['t','YES'],['f','NO']]
}
]
}
]
}
]
});
Here is the definition of my VTypes:
Ext.QuickTips.init();
Ext.apply(Ext.form.field.VTypes, {
depositFlagCheck : function(val, field) {
var paymentFlag = field.up('form').up('form').down('#' + field.pmtField);
if (val == 'YES') {
if (paymentFlag.getValue() == 't') {
return false;
}
}
return true;
},
depositFlagCheckText : 'You cannot require both dep and full payment amount.',
paymentFlagCheck : function(val, field) {
var depositFlag = field.up('form').down('#' + field.depField);
if (val == 'YES') {
if (depositFlag.getValue() == 't') {
return false;
}
}
return true;
},
paymentFlagCheckText : 'Still cannot do it!'
});
Try following and let me know the result. Here, I added an id both component then try to get component value by getValue() method.
(Ext.myapplication extends Ext.grid.Panel)
var form=new Ext.myapplication(
{
layout : {type: 'vbox', align: 'stretch'},
border : false,
items:
[
{
xtype: 'fieldset',
title: 'Deposit Requirements',
items:
[
{
xtype : 'fieldcontainer',
layout:{type: 'hbox'},
border: 0,
items:
[
{
xtype : 'combobox',
name : 'deposit_request_flag',
labelAlign : 'top',
inputWidth : 30,
fieldLabel : 'Requested',
labelStyle : 'font-weight:bold',
valueField : 'deposit_request_flag',
editable : false,
value : 'f',
id : 'deposit_request_flag',
store : [['t','YES'],['f','NO']]
},
{
xtype : 'combobox',
name : 'deposit_required_flag',
labelAlign : 'top',
inputWidth : 30,
fieldLabel : 'Required',
labelStyle : 'font-weight:bold',
valueField : 'deposit_required_flag',
editable : false,
vtype : 'depositFlagCheck',
pmtField : 'payment_required_flag',
value : 'f',
id : 'deposit_required_flag',
store : [['t','YES'],['f','NO']]
}
]
}
]
},
{
xtype: 'fieldset',
title: 'Payment Requirements',
items:
[
{
xtype : 'fieldcontainer',
layout:{type: 'hbox'},
border: 0,
items:
[
{
xtype : 'combobox',
name : 'payment_request_flag',
labelAlign : 'top',
fieldLabel : 'Requested',
labelStyle : 'font-weight:bold',
valueField : 'payment_request_flag',
editable : false,
value : 'f',
store : [['t','YES'],['f','NO']]
},
{
xtype : 'combobox',
name : 'payment_required_flag',
labelAlign : 'top',
fieldLabel : 'Required',
labelStyle : 'font-weight:bold',
valueField : 'payment_required_flag',
vtype : 'paymentFlagCheck',
depField : 'deposit_required_flag',
editable : false,
value : 'f',
store : [['t','YES'],['f','NO']]
}
]
}
]
}
]
});
Ext.QuickTips.init();
Ext.apply(Ext.form.field.VTypes, {
var depVal = Ext.getCmp('deposit_request_flag').getValue(),
payVal = Ext.getCmp('deposit_required_flag').getValue();
depositFlagCheck : function() {
if (depVal == 'YES' && payVal == 't') {
return false;
}
return true;
}

In ExtJS 4.2.2, why does loadRecord() load data, but form does not reflect new data?

Using ExtJS 4.2.2
I have a grid, and when I right click the grid and select Modify from my context menu, a Window with a form is created, and on render, I get the grid selected row record and use the form loadRecord to load the record.
Firebug shows the record was loaded into the form fields, but in the rendered form the fields are enpty.
Any ideas?
Here is some code that illustrates the issue.
If you put a breakpoint at the line with var test = 'test'; you will see the data is loaded into the form's textfields, but then continue past the break point and see the textfields do not reflect the data.
Ext.onReady(function() {
Ext.define('com.myCompany.MyGridModel', {
extend : 'Ext.data.Model',
fields : [{
name : 'name',
type : 'string'
}, {
name : 'address',
type : 'string'
}, {
name : 'type',
type : 'string'
}]
});
var store = Ext.create('Ext.data.Store', {
model: 'com.myCompany.MyGridModel',
proxy: {
type: 'ajax',
url: 'centers.json',
reader: {
type: 'json',
root: 'centers'
}
}
});
store.load();
var grid = Ext.create('Ext.grid.Panel', {
layout: 'fit',
store: store,
columns: [{
text: 'Name',
dataIndex: 'name',
name: 'name'
}, {
text: 'IP Address',
dataIndex: 'address',
name: 'address'
}, {
text: 'Type',
dataIndex: 'type',
name: 'type'
}],
renderTo: Ext.getBody(),
listeners: {
itemcontextmenu : function(view, record, item, index, event){
var selectedItem = record;
event.preventDefault();
new Ext.menu.Menu({
items: [{
text : 'Modify',
handler : function(widget, event) {
Ext.create('Ext.window.Window', {
height : 380,
width : 540,
resizable : false,
closable: true,
modal: true,
layout :{
type : 'fit'
},
items : [{
xtype : 'form',
frame : true,
height : 250,
itemId : 'centerContentForm',
width : 400,
bodyPadding : 10,
items : [{
xtype : 'textfield',
itemId : 'txtName',
height : 30,
width : 401,
fieldLabel : 'Name',
name: 'name',
allowBlank : false
},{
xtype : 'textfield',
itemId : 'txtIPAddress',
height : 30,
width : 401,
fieldLabel : 'Address',
name: 'address',
allowBlank : false,
},{
xtype : 'textfield',
itemId : 'txtType',
height : 30,
width : 401,
fieldLabel : 'Type',
name: 'type',
allowBlank : false
}]
}],
listeners: {
render: function(win) {
win.down('form').loadRecord(selectedItem);
var test = 'test';
}
}
}).show();
} // end of right-click handler
}]
}).showAt(event.getXY());
}
}
});
grid.getView().refresh();
});
Instead of render event handler you should use afterrender event handler.
So your window listeners config should be:
listeners: {
afterrender: function(win) {
win.down('form').loadRecord(selectedItem);
}
}

ExtJS : BUtton actions when extending form panel

How can I call the formpanel.getForm() method when I am trying to override the Ext formpanel?
commentsForm = Ext.extend(Ext.form.FormPanel, {
frame: true,
initComponent: function() {
var config = {
frame : true,
autoScroll : true,
labelWidth : 150,
autoWidth : true,
labelPad : 20,
waitMsgTarget: true,
bodyStyle:'padding:0px 15px 15px 15px',
items: [{
xtype : 'fieldset',
title : 'Write Comment',
anchor : '100%',
defaults : {
selectOnFocus: true,
msgTarget: 'side',
xtype: 'textfield',
width : 200
},
items : [{
xtype : 'textarea',
name : 'comment',
allowBlank : false
}, {
name : 'added_by',
allowBlank : false
}, {
xtype : 'myndatefield',
name : 'added_at',
allowBlank : false,
value : new Date()
}]
}],
buttons: [{
text: 'Add',
handler : function() {
// TODO
var classForm = this.getForm();
console.log(this.getForm());
if (classForm.isValid()) {
console.log(classForm.findField("name"));
}
Ext.WindowMgr.hideAll();
}
}, {
text: 'Cancel',
handler : function() {
Ext.WindowMgr.hideAll();
}
}]
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
myn.commentsForm.superclass.initComponent.apply(this);
}
});
First in your code you are extending not overriding...
commentsForm.getForm() is a way to access BasicForm in your FormPanel if you place var at very beggining, however your code is confusing regarding name spaces: myn.commentsForm.superclass.initComponent.apply(this);

Resources