Code:
Ext.define('Ap.view.TestWindow', {
extend: 'Ext.window.Window',
alias: 'widget.testwindow',
title: 'Test window',
viewModel: {
type: 'default',
formulas: {
valueLength: function(get) {
return get('text.value').length;
}
}
},
layout: 'fit',
modal: true,
width: 400,
height: 300,
buttons: [{
text: 'Save'
}, {
text: 'Cancel',
handler: function() {
this.up('window').close();
}
}],
items: {
xtype: 'form',
layout: 'anchor',
bodyPadding: 15,
autoScroll: true,
border: 0,
items: [{
xtype: 'textarea',
anchor: '100%',
reference: 'text',
publishes: ['value'],
height: 140
}, {
xtype: 'displayfield',
fieldLabel: 'Number of chars:',
bind: '{valueLength} chars'
}]
}
});
Ext.widget('testwindow').show();
Aucun commentaire:
Enregistrer un commentaire