This is gonna sound silly, but I'm new in Extjs 4, I have this window:1.jpg
I need the OK button be enable when the texfield is valid, and disabled when not. I don't know whether to validate the form or the text field.
Code:
Ext.define('App.view.appName', {
extend: 'Ext.window.Window',
alias : 'widget',
title : 'New Record',
layout: 'auto',
autoShow: true,
modal: true,
initComponent: function() {
this.items = [
{
xtype: 'form',
items: [
{
xtype: 'textfield',
name : 'text',
fieldLabel: 'Name',
allowBlank: false
}
]
}
];
this.buttons = [
{
text: 'OK',
action: 'new',
//disable:true
},
{
text: 'Cancel',
scope: this,
handler: this.close
}
];
this.callParent(arguments);
}
});