See if this is what you are looking for:
Code:
var form = Ext.create('Ext.form.Panel', {
title: 'Simple Form',
bodyPadding: 5,
width: 350,
// Fields will be arranged vertically, stretched to full width
layout: 'anchor',
defaults: {
anchor: '100%'
},
tbar: [
{
text: 'Disable',
handler: function(){
Ext.Msg.confirm('Disable field', 'Are you sure?', function (button) {
if (button == 'yes') {
form.down('#firstname').setDisabled(true);
}
});
}
}
],
// The fields
defaultType: 'textfield',
items: [{
fieldLabel: 'First Name',
itemId: 'firstname',
name: 'first',
allowBlank: false
},{
fieldLabel: 'Last Name',
name: 'last',
allowBlank: false
}],
renderTo: Ext.getBody()
});
Scott.