You can retrieve that number even faster with the following bit of code
+new Date
I found the tip here and wanted to surface it.
+new Date
xtype: 'fieldset',
itemId: 'login-form',
name: 'login-form',
items: [
{
xtype: 'textfield',
placeHolder: 'Username',
itemId: 'user-name-text-field',
required: true,
autoComplete: false,
autoCorrect: false
},
{
xtype: 'passwordfield',
placeHolder: 'Password',
itemId: 'password-text-field',
required: true
}
]
},
{
xtype: 'button',
itemId: 'login-button',
action: 'login',
// This is just a color style
ui: 'action',
text: 'Log in',
cls: 'login-button'
}
Now let's set up the Controller.
config: {
control:{
// Listen for the login button
'button[action=login]':{
tap: 'tryLogin'
},
// Listen for a field form submit
'fieldset[name=login-form]':{
action: 'tryLogin'
}
}
}
I listen for events in the Controller instead of launching events through the Application from the View and listening for them elsewhere. The View is kept nice and clean and all the logic is in the Controller where it belongs. The Controller can grab a reference to the View and update whatever it needs.$
var fileField = $('',{
'id': 'picker-2',
'type': 'file'});
$('#fields').append(fileField);
var fileField = $('',{
'id': 'picker-2',
'type': 'file'});
$('#fields').append(fileField.clone());
// Building a button inside of an items array
{
xtype: 'button',
action: 'warnOnLeave',
align: 'left',
iconCls: 'home',
ui: 'back',
}
// Handle the button click inside a controller
control: {
// Listen for the new button press
'button[action=warnOnLeave]':{
tap: 'onCreateNewContent'
}
}
Ext.define("Sample.view.ContentEditorContainer",{
extend: 'Ext.tab.Panel',
alias: 'widget.contenteditorcontainer',
config: {
// How to center tabs in a panel floating at the top
tabBar: {
layout: {
type: 'hbox',
align: 'center',
pack: 'center'
}
},