Ext.create('Ext.window.Window', {
title: 'Set Date',
closable: false,
width: 500,
layout: 'vbox',
bodyStyle: 'padding: 5px;',
items: [{xtype: 'container',
layout: {
type: 'hbox',
align: 'stretch'
},
items: [{
xtype: 'datepicker',
minDate: new Date(),
bodyStyle: 'padding-left: 50px;',
handler: function(picker, date) {
Ext.getCmp('txtDate1').setValue(Ext.Date.format(date, 'Y-m-d'));
Ext.getCmp('txtDate2').setValue(Ext.Date.format(date, 'd-m-Y'));
}
}, {
xtype: 'container',
layout: {
type: 'vbox',
align: 'stretch'
},
items: [{
xtype: 'textfield',
fieldLabel: 'Date 1:',
labelAlign: 'right',
id: 'txtDate1',
width: 200
}, {
xtype: 'textfield',
fieldLabel: 'Date 2:',
labelAlign: 'right',
id: 'txtDate2',
width: 200
}]
}]
}]
}).show();
<script src="http://cdn.sencha.com/ext/gpl/4.2.0/ext-all.js"></script>
<link type="text/css" rel="stylesheet" href="http://cdn.sencha.com/ext/gpl/4.2.0/resources/css/ext-all.css")/>
시도는 항목 ID '' '대신에 ID의 usernameID'''usernameID'' 또는'Ext.getCmp ('[NAME = 자명])' – Zoran
우선적 대신 사용하여 DateField 텍스트 필드 xtype : datefield, value : new Date(). http://docs.sencha.com/extjs/5.1.0/api/Ext.form.field.Date.html을 살펴보십시오. – josei